| Mindapolis |
Dec 27 2011, 02:18 PM
Post
#1
|
|
Member ![]() ![]() ![]() Group: Members Posts: 67 Joined: 2-April 11 Member No.: 14,256 |
Hi, I'm trying to make a form sticky but when I display it on the web I get a blank page. I'm following the example given in my PHP book I'm wondering if there 's an error in the book because it has 2 closing form tags which I didn't think was right. I'm going to paste the code and attach the page that has the example I'm following.
For some reason it 's not uploading the example. Are pdfs allowed? CODE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $errors=array(); if(isset($_POST['submit'])){ validate_input(); //checks for empty fields if(count($errors) !=0){ display_form(); } else { display_form(); } } function validate_input(){ global $errors; if($_POST["name"] == ""){ $errors['name']="<font color='red'> please enter your name </font>"; } } function display_form(){ global $errors; ?> <form action="" method="post"> Name: <input name="name" type="text" size="10" maxlength="10" value = "<?php echo $_POST[name]; ?>"/> <br /> <?php echo $errors['name']; ?> <br /> Email: <input name="email" type="text" size="15" maxlength="30" /><br /> <input name="submit " type="submit" value="submit " /> </form> <?php } ?> </body> </html> This post has been edited by Mindapolis: Dec 27 2011, 02:23 PM |
![]() ![]() |
| Christian J |
Dec 27 2011, 05:37 PM
Post
#2
|
|
. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 4,759 Joined: 10-August 06 Member No.: 7 |
|
Mindapolis sticky form not working Dec 27 2011, 02:18 PM
pandy I see only one closing tag for FORM. Dec 27 2011, 03:21 PM
Mindapolis but I'm not getting any errors Dec 27 2011, 03:36 PM
Darin McGrew I'm confused. What is the problem? Dec 27 2011, 04:07 PM
pandy I'd say that if the examples in the books have... Dec 27 2011, 05:46 PM
pandy One thing though, have you checked if the book has... Dec 27 2011, 05:47 PM
pandy
For some reason it 's not uploading the examp... Dec 27 2011, 07:01 PM
Darin McGrew For some reason it 's not uploading the exampl... Dec 27 2011, 07:25 PM
pandy To the left of the attachment field it says ... Dec 27 2011, 07:39 PM
Mindapolis Darin, it acts like it uploads the pdf but it does... Dec 27 2011, 08:53 PM
Mindapolis got it working Dec 27 2011, 09:26 PM![]() ![]() |
|
Lo-Fi Version | Time is now: 21st May 2013 - 10:32 PM |