Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old December 15th, 2005, 09:12 AM
AVillatoro AVillatoro is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Honduras
Posts: 1 AVillatoro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Undefined variables from POST

Hello.
I'm very new to PHP and am having trouble with my first form.
I've tried a very simple HTML page that captures the user's name and age and then POSTs them to a PHP page that welcomes the user by reporting their name and age.
The error I'm getting is that the variables are not defined.
I'm working on a Windows XP desktop, coding in PHP 5 running from an Apache 2 server.

The code for the HTML page is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Get user info...</title>
</head>
<body>
<h1>Who are you??</h1>
<hr>
<form action="simplewelcome.php" method="post">
<p>Your name: <input type="text" name="name" /></p>
<p>Your age: <input type="text" name="age" /></p>
<p><input type="submit" /></p>
</form>
<hr>
</body>
</html>


...and the code for the PHP page is...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Get user info...</title>
</head>
<body>
<h1>Welcome!</h1>
<hr>
Hi <?php echo $_POST['name']; ?>!
You are <?php echo $_POST['age']; ?> years old.
<hr>
</body>
</html>

You'll probably recognize that these are taken straight from the PHP manual, so I have no idea of what's going wrong.

Thanks in advance for the help!


Reply With Quote
  #2  
Old December 15th, 2005, 01:13 PM
asim0s asim0s is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: nicosia,cyprus
Posts: 48 asim0s User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 3 m 31 sec
Reputation Power: 2
Send a message via ICQ to asim0s Send a message via Yahoo to asim0s
RE: Undefined variables from POST

the script you posted works form me but i have php 4.2.3

Reply With Quote
  #3  
Old December 15th, 2005, 01:24 PM
moon moon is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 356 moon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 56 m 39 sec
Reputation Power: 2
Send a message via Yahoo to moon
RE: Undefined variables from POST

In your form attribute, i removed the:
action="simplewelcome.php"

Then, it works fine.
what does the "simplewelcome.php" file do?

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Undefined variables from POST


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT