The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> sticky form not working
Mindapolis
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies(1 - 11)
pandy
post Dec 27 2011, 03:21 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



I see only one closing tag for FORM.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mindapolis
post Dec 27 2011, 03:36 PM
Post #3


Member
***

Group: Members
Posts: 67
Joined: 2-April 11
Member No.: 14,256



but I'm not getting any errors
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Dec 27 2011, 04:07 PM
Post #4


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



I'm confused. What is the problem?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 27 2011, 05:37 PM
Post #5


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



QUOTE(Mindapolis @ Dec 27 2011, 08:18 PM) *
I'm following the example given in my PHP book

There are several errors in the example that you should be able to spot yourself. If not, you're moving on too fast with the book...


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 27 2011, 05:46 PM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



I'd say that if the examples in the books have errors, you're reading the wrong book.

Sorry, can't help with the original question. Not that I'm sure what it is anymore.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 27 2011, 05:47 PM
Post #7


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



One thing though, have you checked if the book has an errata page online? May be something there if it has.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 27 2011, 07:01 PM
Post #8


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



QUOTE(Mindapolis @ Dec 27 2011, 08:18 PM) *

For some reason it 's not uploading the example. Are pdfs allowed?


I honestly don't know. Darin?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Dec 27 2011, 07:25 PM
Post #9


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



QUOTE(pandy @ Dec 27 2011, 04:01 PM) *
QUOTE(Mindapolis @ Dec 27 2011, 08:18 PM) *
For some reason it 's not uploading the example. Are pdfs allowed?
I honestly don't know. Darin?
PDF files are allowed. Or at least, they should be. What happens when you try to upload one?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 27 2011, 07:39 PM
Post #10


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



To the left of the attachment field it says "Global Space Left: 4.13mb". Does that mean what it sounds like? unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mindapolis
post Dec 27 2011, 08:53 PM
Post #11


Member
***

Group: Members
Posts: 67
Joined: 2-April 11
Member No.: 14,256



Darin, it acts like it uploads the pdf but it does not. Also, when I view the script on the web I get a blank page and it should display a form. //
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mindapolis
post Dec 27 2011, 09:26 PM
Post #12


Member
***

Group: Members
Posts: 67
Joined: 2-April 11
Member No.: 14,256



got it working
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 04:51 AM