Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 5th, 2007, 10:15 AM
Authorized User
 
Join Date: Mar 2007
Location: , , .
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


Reply With Quote
  #2 (permalink)  
Old April 5th, 2007, 10:17 AM
Authorized User
 
Join Date: Mar 2007
Location: , , .
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>




Reply With Quote
  #3 (permalink)  
Old April 5th, 2007, 05:47 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
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!! ***

Reply With Quote
  #4 (permalink)  
Old April 10th, 2007, 09:16 AM
Authorized User
 
Join Date: Mar 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:40 PM.


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