Jump to content

POST not working


1337coder2006

Recommended Posts

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

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]<?php
if (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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.