我有需要执行以下步骤的页面:后表单,等待10秒钟,然后重定向到
第1步 - 通过POST
步骤(2)接收URL地址,名称,价值,NUM和ID - 等待10秒钟
步骤3 - 发送(也可以通过交)经由交接收以下信息:名称,值Num和ID,通过柱接收到的URL
步骤4 - 重定向到该接收到的URL该帖子并在屏幕上打印帖子。
为此,我使用下面的代码,但任何事情都会出错,因为重定向的URL中的打印应该会使发布信息变空,所以看起来像是出于任何原因信息不是正确发布。
有人能告诉我我做错了什么吗?
代码:
HTML - 创建表来发表:
<form id="ret" name="return_url" method="post" action="<?php print_r($_POST['url']);?>">
<input type="hidden" name="name" value="<?php print_r($_POST['name']);?>" />
<input type="hidden" name="value" value="<?php print_r($_POST['value']);?>" />
<input type="hidden" name="num" value="<?php print_r ($_POST['num']);?>" />
<input type="hidden" name="ID" value="<?php print_r($_POST['ID']);?>" />
<input type="hidden" name="status" value="OK" />
</form>
张贴的URL内容添加到VAR $retorno
将在Javascript(PHP)使用:
<?php
$retorno = $_POST['url'];
?>
启动计数器,提交表单并重定向(使用javascript):
<script language="javascript" type="text/javascript">
window.onload = function() {
function countdown() {
if (typeof countdown.counter == 'undefined') {
countdown.counter = 10; // initial count
}
if (countdown.counter > 0) {
document.getElementById('count').innerHTML = countdown.counter--;
setTimeout(countdown, 1000);
}
else {
document.getElementById("ret").submit();
location.href = '<?php echo $retorno?>';
}
}
countdown();
};
</script>