这段代码运行良好 但是,从表单页面发送值 "> 这为下一页提供了一个值 document.location.hre-6ren">
gpt4 book ai didi

php - <script> document.location.href ='' ;</script> & 跳转到页面相关问题

转载 作者:行者123 更新时间:2023-12-04 04:34:52 25 4
gpt4 key购买 nike

<? echo "<script> document.location.href='main.php';</script>"; ?>

这段代码运行良好

但是,从表单页面发送值
<form action="smssend.php" method="post" id="quickform"> 
<input type="hidden" name="returnUrl" value="<? =PHP_SELF?>">

这为下一页提供了一个值
<? echo "<script> document.location.href='$_POST[returnUrl]';</script>"; ?>

如果源和页面不会移动,则会发生运行时错误。

我错了吗?

在表单页面下我收到的短信联系电话号码引用页面源码来处理的少。
<?php

$config['SMS_ID']="test";
$config['SMS_PW']="test1234";
$config['cf_tel']='01234567';

$post_data = array(
"remote_id" => $config['SMS_ID'],
"remote_pass" => $config['SMS_PW'],
"remote_num" => 1,
"remote_reserve" => 0,
"remote_phone" => $_POST[number],
"remote_callback" => $config['cf_tel'],
"remote_msg" => $_POST[counsle]
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.mymunja.co.kr/Remote/RemoteSms.html" );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$msg = curl_exec($ch);
curl_close($ch);
?>
<? echo "<script> alert('Done');</script>"; ?>
<? echo "<script> document.location.href='$_POST[returnUrl]';</script>"; ?>

最佳答案

<? echo "<script> document.location.href="$_POST[returnUrl]";</script>"; ?>

你的问题是字符串分隔符

关于php - &lt;script&gt; document.location.href ='' ;&lt;/script&gt; & 跳转到页面相关问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19897764/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com