Re: IE/ IIS / PHP - Form posted twice in case of redirection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Even this didn't work. It seems IE just posts twice the same form on its own
and redirect is blank both times.

Is there any utility to debug what database is being passed around like
avaiable in firefox
Sukhwinder Singh



----- Original Message ----- From: "Dan Shirah" <mrsquash2@xxxxxxxxx>
To: "Sukhwinder Singh" <ssruprai@xxxxxxxxxxx>
Cc: <php-windows@xxxxxxxxxxxxx>
Sent: Wednesday, June 25, 2008 6:11 PM
Subject: Re: IE/ IIS / PHP - Form posted twice in case of redirection


>
Sukhwinder,

I would suggest trying something simple like adding a variable to see if
your page posted. Then, if it has run a simple Javascript function to
redirect your page.

<head>
<script language="JavaScript">
<!--
function redirect() {
  location.replace(http://URL);
}
//-->
</script>
</head>
<?php
$redirect = $_POST['redirect'];
if ($redirect == "Y") { ?>
<body onload="redirect()">
<?php } else { ?>
<body>
<?php } ?>
<form name="MyForm" action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post">
<input type="hidden" name="redirect" value="Y">
<ALL YOUR OTHER FORM DATA HERE>
<input type="submit" name="Submit" value="Submit">
</body>

So, by default the value of $redirect will be "".  Once you put data into
your form and submit it, the value of $redirect will be "Y" in which case
the Javascript function will be called and send you to your other page.

Hopefully that helps.

Dan




--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux