bhazzard Posted January 20, 2006 Share Posted January 20, 2006 I want PHP to accept the form variable userName and print it... but it want. Globals are set to off, but I've done a work around that should work.HTML File:<html><head><title>What’s your name?</title></head><body><h1>What’s your name?</h1><h3>Writing a form for user input</h3><form method="post" action="hiUser.php">Please type your name:<input type="text" name="userName" value=""><br><input type="submit"></form></body></html>PHP File:<html><head><title>hiUser.php</title></head><body><h1>Hi User</h1><h3>PHP program that receives a value from "whatsName"</h3> <?php /*gets the variables from the form on whatsName.html and outputs text*/ //retrieves the userName element from the form $userName = $_REQUEST[“userName”]; //outputs text and html echo "<h3>Hi there, $userName!</h3>"; ?></body></html>Thanks in advance for your help. I am a newbie and I am trying to learn. Link to comment Share on other sites More sharing options...
aliendisaster Posted January 30, 2006 Share Posted January 30, 2006 $userName = $_REQUEST[userName]; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now