Does anyone have a simple answer for me as to why the GET variables of a link would persist following a POST form?
I have a script that points to itself when modifying data, sometimes with GET, sometimes with POST.. and it chooses its action based on the contents of these arrays. Opening the page with no arguments presents a table with links back to the same page, but with GET variables in the link. The script then displays a POST form, the users fills it out, and hits the submit button. Problem is, the GET variables don't go away after POSTing.. they stay in the URL, which causes the wrong processing.
The code was originally written on a machine with PHP 4.3+, and was moved to a 4.07 server... and this behavior wasn't occuring before the move.. but as a test, I wrote:
testing.php:
<?php
if($POST['dave']) {echo "Posted.<br>"; print_r($GET); }
else
echo "<html><head><body>
<form method=post action=$PHP_SELF>
<input type='text' name='dave' size='10'>
<input type='submit'>"
?>
And that exhibits the same behavior on both servers. That is, if I load "testing.php?anything", then enter anything into the form, the url keeps the ?anything after the post. I'm pulling my hair out on this one.. any ideas?