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. Link to comment https://forums.phpfreaks.com/topic/49913-solved-_post-not-working/ 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']. Link to comment https://forums.phpfreaks.com/topic/49913-solved-_post-not-working/#findComment-244917 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. Link to comment https://forums.phpfreaks.com/topic/49913-solved-_post-not-working/#findComment-244921 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:"? Link to comment https://forums.phpfreaks.com/topic/49913-solved-_post-not-working/#findComment-244924 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. Link to comment https://forums.phpfreaks.com/topic/49913-solved-_post-not-working/#findComment-244927 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. Link to comment https://forums.phpfreaks.com/topic/49913-solved-_post-not-working/#findComment-244929 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. Link to comment https://forums.phpfreaks.com/topic/49913-solved-_post-not-working/#findComment-244937 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... ??? Link to comment https://forums.phpfreaks.com/topic/49913-solved-_post-not-working/#findComment-244939 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. Link to comment https://forums.phpfreaks.com/topic/49913-solved-_post-not-working/#findComment-244941 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.