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> Link to comment Share on other sites More sharing options...
Selacius Posted January 20, 2006 Share Posted January 20, 2006 Do you need to post this 3 times? Link to comment Share on other sites More sharing options...
bhazzard Posted January 21, 2006 Author Share Posted January 21, 2006 Do you need to post this 3 times?<{POST_SNAPBACK}> Yea, my apologies... the board was running slow, and I didnt realize that it was posting... Then I couldnt figure out how to delete the others. Any ideas for how I can fix this? Link to comment Share on other sites More sharing options...
bd1e0d0 Posted January 24, 2006 Share Posted January 24, 2006 Ask an admin or a mod to clean it up, that's all I can think of. 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