1337coder2006 Posted December 13, 2006 Share Posted December 13, 2006 I have a self-submitting form which echo's what you enter in the text field. The problem with my form is that it only works on the first submission! If you submit it again, $_POST['testing'] is empty, and you can find what you entered the previous time in the Request Method. Submit the form again and the same thing happens.I have an example of it at [url=http://www.my-torrents.com/testing.php]http://www.my-torrents.com/testing.php[/url]testing.php:[code]<strong>Post Data:</strong> <?=$_POST['testing'];?> <br /><strong>HTTP Post Data:</strong> <?=$HTTP_POST_VARS['testing'];?> <br /><strong>Request Method:</strong> <?=$_SERVER['REQUEST_METHOD'];?> <br /><br /><form action="./testing.php" method="post">Test: <input type="text" name="testing" /><br /><input type="submit" value="Submit" /></form>[/code]I've tried the same code on a different server and it works fine. Does anyone know what could be causing this?Thanks,Ryan Link to comment https://forums.phpfreaks.com/topic/30535-post-not-working/ Share on other sites More sharing options...
The Little Guy Posted December 13, 2006 Share Posted December 13, 2006 <strong>Post Data:</strong> <?echo$_POST['testing'];?> <br /><strong>HTTP Post Data:</strong> <?echo$HTTP_POST_VARS['testing'];?> <br /><strong>Request Method:</strong> <?echo$_SERVER['REQUEST_METHOD'];?> <br /><br /> Link to comment https://forums.phpfreaks.com/topic/30535-post-not-working/#findComment-140571 Share on other sites More sharing options...
kenrbnsn Posted December 13, 2006 Share Posted December 13, 2006 To The Little Guy:This string "<?=" is a shorthand for "<?php echo", so you just suggested changing the OP's debug statements.To the OP:Try this code instead:[code]<?phpif (isset($_POST['submit'])) { echo '<pre>' . print_r($_POST,true) . '</pre>'; echo '<pre>' . print_r($_SERVER,true) . '</pre>';}?><form method="post">Test: <input type="text" name="testing" /><br /><input name="submit" type="submit" value="Submit" /></form>[/code]Ken Link to comment https://forums.phpfreaks.com/topic/30535-post-not-working/#findComment-140579 Share on other sites More sharing options...
1337coder2006 Posted December 13, 2006 Author Share Posted December 13, 2006 I'm 100% sure this is not a coding error. I have tried my same code on 3 different servers, it works on the other 2, but not on my-torrents.com. I called godaddy (my host) and they told me it was a problem with my code, those bastards. This is really ticking me off, i was on the phone for a couple of hours with them and the supervisor was the biggest prick of all. Usually you speak to a supervisor, you expect them to fix the problem for you, but this guy just told me there's nothing he can do, he wouldn't even transfer me to someone who could help me, he wouldn't listen to my problem, he was just being an ignorant prick. Burn in hell godaddy.com, if anyone has any idea what's going on, i'll leave the testing page up ([url=http://www.my-torrents.com/testing.php]http://www.my-torrents.com/testing.php[/url]). I really need to get this fixed!Thanks for all your help,Ryan Link to comment https://forums.phpfreaks.com/topic/30535-post-not-working/#findComment-140632 Share on other sites More sharing options...
kenrbnsn Posted December 13, 2006 Share Posted December 13, 2006 Create a script with the following line in it.[code]<?php phpinfo(); ?>[/code]Up load it to the servers where everything works and to the server where it doesn't. Compare the output, especially things like the version of PHP.Ken Link to comment https://forums.phpfreaks.com/topic/30535-post-not-working/#findComment-140643 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.