为了防止用户在提交表单后点击他们的后退按钮,我想在颜色框模式中打开下一页。我的表单操作是调用一个 php 页面,该页面将数据提交到 MySql,然后使用位置标头重定向到 page.php,然后要求他们提交照片作为提交过程中的第二步。
这是我在第一页上使用的带有提交按钮的代码,它打开了颜色框模式“
<script>
jQuery(document).ready(function(){
jQuery(".modal").colorbox({modal:true, width:"748px", height:"92%"});
});
</script>
<form action='submit.php' method='post' enctype='multipart/form-data' name='form1' onSubmit='jQuery.fn.colorbox()'>
// input data
<input name='save_button' type='submit' id='save_button' value='Save Settings'>
这是我的 submit.php 页面的代码:
<?php
// updatequery code
header("Location: page.php");
?>
单击提交按钮时,颜色框会打开一个模式,但随后会立即关闭,同时 submit.php 页面中的代码会重定向到 page.php
如何让表单 action=submit.php 和随后的位置标头重定向 page.php 出现在颜色框模式中?