DJTim666 Posted May 4, 2007 Share Posted May 4, 2007 Does anyone see anything wrong with this coding? Information.php <html> <body> <form action="script.php" method="post"> Username: <input name="user" type="text" /> <input value="Submit" type="submit" /> </form> </body> </html> Script.php <?php $user = $_POST ['user']; echo "Username: $user"; ?> I have been over the code 400 times, and it should work perfectly. But when I insert it, for some reason it will not post the username entered on the previous page. Quote Link to comment Share on other sites More sharing options...
john010117 Posted May 4, 2007 Share Posted May 4, 2007 Script.php <?php $user = $_POST['user']; echo "Username: $user"; ?> Don't put a space between $_POST and ['user']. Quote Link to comment Share on other sites More sharing options...
DJTim666 Posted May 4, 2007 Author Share Posted May 4, 2007 Nope, still doesn't do the trick. Quote Link to comment Share on other sites More sharing options...
john010117 Posted May 4, 2007 Share Posted May 4, 2007 What exactly is the output? Does it at least echo "Username:"? Quote Link to comment Share on other sites More sharing options...
DJTim666 Posted May 4, 2007 Author Share Posted May 4, 2007 Yes, it echo's Username: and then it is blank. Quote Link to comment Share on other sites More sharing options...
john010117 Posted May 4, 2007 Share Posted May 4, 2007 Strange... try this: <?php error_reporting(E_ALL); $user = $_POST['user']; echo "Username: $user"; ?> and see if you get any error messages. Quote Link to comment Share on other sites More sharing options...
DJTim666 Posted May 4, 2007 Author Share Posted May 4, 2007 <input type="text" name"name" /> Even after 400 times of looking over the same code you would have thought I could catch the missing =. Thanks for the help though. I feel so stupid now rofl. Quote Link to comment Share on other sites More sharing options...
john010117 Posted May 4, 2007 Share Posted May 4, 2007 There was no missing = sign in the code that you've posted though... ??? Quote Link to comment Share on other sites More sharing options...
DJTim666 Posted May 4, 2007 Author Share Posted May 4, 2007 I know, I re-wrote that code because I didn't feel like going through my files to find that file. I just remembered I had that problem, and I needed help. But I just happen to come across it and seen the = sign missing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.