I have this chunk of code executing at the top of a page in an if statement.
$theform = '
<form action="'.$unisonprocurl.'" method="post" name="logger" id="logger">
<input name="'.$sessionid.'" type="hidden" id="'.$sessionid.'" value="login">
<input name="uid" type="hidden" id="uid" value="'.$_COOKIE['uid'].'">
<input name="rem" type="hidden" id="rem" value="1">
<input name="sendto" type="hidden" id="sendto" value="'.$PHP_SELF.'?'.$_SERVER['QUERY_STRING'].'">
</form>
';
$submitter = '<script>document.getElementById("logger").submit();</script>';
echo $theform;
echo $submitter;
This form submits as expected, however, the "sendto" form field has the URL for the page the form submits TO, not where it submitted FROM!
If I do not echo the $submitter and take a look at the HTML code output, the "sendto" form field has the current and correct URL in it.
What gives?