RonDahl Posted October 16, 2009 Share Posted October 16, 2009 My html file contains: <form action="http://localhost/genealogy/testitem.php" method=post> <input type="text" name="mysubmission" size ="10" maxlength="3"> <input type="submit" value="Submit"> </form> My php file contains: <html> <head> <title>MyPage</title> </head> <body> <h1>MyPage</h1> <?php // create short variable names $mytitle=$HTTP_POST_VARS['mysubmission']; echo $mytitle.'is my title'; ?> </body> </html> When I click the Submit button, the php page comes up with MyPage at the top and a line "is my title" on the second line, but there are no values passed to $mytitle. It works fine if I ftp it to HostMonster. Is there a configuration setting that I need to change? Thanks in advance for any help. Ron Dahl Quote Link to comment https://forums.phpfreaks.com/topic/177977-solved-passing-forms-value-problem/ Share on other sites More sharing options...
trq Posted October 16, 2009 Share Posted October 16, 2009 Is there a configuration setting that I need to change? There is, but the problem is your using deprecated code. Use the $_POST array instead of $HTTP_POST_VARS. Quote Link to comment https://forums.phpfreaks.com/topic/177977-solved-passing-forms-value-problem/#findComment-938396 Share on other sites More sharing options...
RonDahl Posted October 17, 2009 Author Share Posted October 17, 2009 Thank you very much. I could have SWORN that I tried that yesterday. Anyway, to my great delight, your suggestion worked perfectly today. Ron Dahl Quote Link to comment https://forums.phpfreaks.com/topic/177977-solved-passing-forms-value-problem/#findComment-938659 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.