Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie IF - ELSE doesn't work

Status
Not open for further replies.

streborr

IS-IT--Management
Jan 16, 2002
98
I've decided to learn PHP as an alternative to ASP.
I can't seem to get even the simplist code to work.
When I submit the form, with me in the Username box, the result page always returns the "go away" result.
Thanks for any help!

here's the form:
Code:
<html>
<head>
       <title>form page</title>
</head>
<body>
<FORM action="result.php" method="post">
Username: <input type="text" name="fname" />
<br />
<input type="submit" value="go" />
</FORM>
</body>
</html>

here's the result page:
Code:
<html>
<head>
       <title>result page</title>
</head>
<body>
<?php
if ($_post['fname']=="me")
{   echo "hi me";
} else {
    echo "go away";
}
?>
</body>
</html>
 
Note that PHP uses case sensitive variable names:
$_POST is something completely different thatn $_post. That should solve this.
 
Thanks DRJ478!

(response would have been sooner, but lost connection to net)

&quot;Without deviation, progress is not possible.&quot;
Frank Zappa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top