|
-
April 15th, 2005, 10:36 AM
#1
PHP Basics - Frustrated
Hi all. OK, Perl novice trying to learn PHP. I'm on XPSP2, Apache2 and PHP 5.0.4. Just installed everything, and trying this simple little form to test if PHP is working right...
<html>
<head><title>PHP says Hello</title></head>
<body>
<form method "POST" action="sayhello.php">
Your Name: <input type="text" name="user">
<input type="submit" value="Say">
</form>
</body>
</html>
sayhello.php is as follows...
<?php
print "Hello, ";
print $_POST['user'];
print "!";
?>
And finally, the result is... Hello, !
I have checked the Apache config, online sites and googled the error message in the Apache error log that says...
[client 127.0.0.1] PHP Notice: Undefined index: user in D:\\Apache2\\htdocs\\sayhello.php on line 4, referer: http://localhost/test.html
This is the first step and it is not working! At my wits end...HELP!
NOTE: I tried running a simple script that checks if PHP is installed right with your Apache server... <?phpinfo() ?> ...and it works fine!!!
Thanks,
Sonya
-
April 15th, 2005, 11:56 AM
#2
Re: PHP Basics - Frustrated
Code:
<form method "POST" action="sayhello.php">
Your Name: <input type="text" name="user">
<input type="submit" value="Say">
</form>
You are missing one minor thing. The "=" sign between "method" and "POST".
Code:
<form method="post" action="sayhello.php">
Your Name: <input type="text" name="user">
<input type="submit" value="Say">
</form>
Last edited by peejavery; April 15th, 2005 at 11:58 AM.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
April 21st, 2005, 12:26 AM
#3
Re: PHP Basics - Frustrated
Nice answer
I am inviting you to join GreenZap. It is just like PAYPAL but it is more rewarding! You get $25 when you join (FREE to sign up) AND you get rewarded also when someone opened an account using your GreenZap promo code! GreenZap is launching June 1st.
Click here and PREREGISTER
Have a break. Visit JonelsPlace
-
April 21st, 2005, 11:08 PM
#4
Re: PHP Basics - Frustrated
I cannot believe it was such a stupid thing! Thanks for taking the time and correcting me!!
Grateful,
Sonya
-
April 23rd, 2005, 01:18 AM
#5
Re: PHP Basics - Frustrated
Sometimes we miss the little things.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|