我有一个处理付款提供商付款的脚本,然后使用PHP
重定向显示“谢谢”页面。标题位置重定向使PHP命令执行两次
来源:(Websend.php包括源是在这里:http://pastebin.com/raw.php?i=TmmysJiD)success.html的
include_once 'Websend.php';
if ($file != "GREAT") {
header("Location: ../failed.html");
exit();
} else {
$ws = new Websend("192.168.56.105");
$ws->connect("passwd");
$ws->doCommandAsConsole("give " . $token . " 2000");
$ws->disconnect();
header('Location: ../success.html');
exit();
}
源
<head>
<meta http-equiv="refresh" content="0; url=http://site.com/index.html">
</head>
<script type="text/javascript">
alert("Some alert");
</script>
然而header("Location: ../success.html");
导致该命令运行两次(并为用户金额为两次,不应该发生。 当我删除header("Location: ../success.html");
时,代码的工作原理应该是这样:
为什么会发生这种情况?
是代码'succes.html'?如果是的话,答案应该是不言而喻的 – 2013-08-26 20:32:36
请发布'succes.html' –
@Dagon的内容否,这是付款提供商重定向到的PHP文件。 – Timothy