Wrox Programmer Forums
|
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
This is the forum to discuss the Wrox book Beginning PHP5, Apache, and MySQL Web Development by Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass; ISBN: 9780764579660
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 5th, 2007, 10:15 AM
Authorized User
 
Join Date: Mar 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Forms - This should be simple.

Hello members,

I did not expect to have any issues at this stage, but I am.
I am on chapter 4, page 141-142.

Once I create "form2.html" and press the "submit" button my script is not finding the "formprocess2.php" I get the "the page cannot be found"

Both files are in the same folder.
I doublechecked that I have the correct spelling in "forms2.html" and it is correct.

Any hints/suggestions that you can give me??
THANK YOU!

Gargamel


 
Old April 5th, 2007, 10:17 AM
Authorized User
 
Join Date: Mar 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here are the scripts:


**************FORM2.HTML************

<html>
<head>
<title> Greetings Earthling</title>
<style type ="text/css">
TD{color:#353535;font-family:verdana}
TH{color:#FFFFFF;font-family:verdana;background-color:#336699}
</style>
</head>
<body>
<form action ="formprocess2.php method="post">
<table border="0" cellspacing="1" cellpadding="3"
    bgcolor="#353535" align="center">
    <tr>
    <td bgcolor="#FFFFFF" width="50%">Name</td>
    <td bgcolor="#FFFFFF" width="50%">
    <input type="text" name="Name">
    </td>
    </tr>
    <tr>
    <td bgcolor="#FFFFFF">Greetings</td>
    <td bgcolor="#FFFFFF">
        <select name="Greeting">
        <option value="Hello">Hello</option>
        <option value="Hola">Hola</option>
        <option value="Bonjour">Bonjour</option>
        </select>
    </td>
    </tr>
    <tr>
        <td bgcolor="#FFFFFF" width="50%">Display Debug info</td>
        <td bgcolor="#FFFFFF" width="50%">
            <input type="checkbox" name="Debug" checked>
        </td>
    </tr>
    <tr>
        <td bgcolor="#FFFFFF" colspan=2 align="center">
        <input type="submit" name="SUBMIT" value="Submit">
        <td>
    </tr>
</table>
</form>
</body>
</html>



*************formprocess2.php********************

<html>
<head>
<title> Greeting Earthling </title>
<style type="text/css">
TD{color:#353535;font-family:verdana}
TH{color:#FFFFFF;font-family:verdana;background-color:#336699}
</style>
</head>
<body>
<?php
if (isset($_POST['Debug']) and $_POST['Debug'] == "on") {
?>
<pre>
<?php
    print_r($_POST);
?>
</pre>
<?php
}
?>

<p align="center"><?php echo $_POST['Greeting']; ?>
<?php echo $_POST['Name']; ?></p>
</body>
</html>




 
Old April 5th, 2007, 05:47 PM
Authorized User
 
Join Date: Feb 2006
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Heyy whats up buddy? Your code is pretty flawless you only had one error... I will show you below...


**************FORM2.HTML************

<html>
<head>
<title> Greetings Earthling</title>
<style type ="text/css">
TD{color:#353535;font-family:verdana}
TH{color:#FFFFFF;font-family:verdana;background-color:#336699}
</style>
</head>
<body>
<form action ="formprocess2.php method="post">
<table border="0" cellspacing="1" cellpadding="3"

**** The error is <form action = "formprocesss2.php you forgot to complete that part with an ending " it should be
<form action = "formprocess2.php" <--- without the ending quote your other code underneath isn't really alive... it doesn't know whats going on until after you close that. Kind of like writing a sentence after you put the period . You continue on another sentence etc etc etc.. but if you didn't put a period when you should the whole thing just runs on.. does that make sense hahah sorry... bottom line..just a minor syntax error not a big deal... Take Care!! ***

 
Old April 10th, 2007, 09:16 AM
Authorized User
 
Join Date: Mar 2007
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

damn...no room for error. Thank you! I'm marching through chapter 5 :)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Q Apocolypse2005 Beginning VB 6 5 August 8th, 2007 08:04 AM
Simple 'passing variables between forms' issue... overture C# 4 October 14th, 2005 02:30 PM
Opening forms from other forms Paulsh Access VBA 1 September 30th, 2004 06:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.