In my index.php page I have a submit button which takes form data and sends it through POST to an update.php page. On this new page, the database is manipulated then redirects (with PHP) back to the original page. This redirection process works fine in Firefox, but does not seem to work in Chrome/IE.
Relevant code in index.php file:
<form name="battle" action="update.php" method="post">
<input type="radio" name="update" value="<?php print($names[0] . "+" . $names[1]); ?>" />
<input type="radio" name="update" value="<?php print($names[1] . "+" . $names[0]); ?>" />
<input type="submit" name="submit" value="Submit" />
</form>
This is the code at the end of my update.php file:
$con->close();
session_write_close();
header("Status: 200");
header( "Location: index.php" );
exit(0);
This code will work in all browsers if the submit button is NOT disabled onClick, but I really need to have this feature. Does anyone know how to make this redirect work while still having the disable button fetaure?
Disabling submit buttons on form submits can be a tricky business. This worked for me:
NB: Requires >= jQuery1.6 to work
test.php:
update.php: