【发布时间】:2015-02-08 17:36:40
【问题描述】:
这个 php 代码是使用 ajax 执行的。执行标头语句后,Ajax 请求不会返回。
if(is_numeric($phone) && strlen($phone)==10){
$text = "Hi $name, your account created at hhhhh. Check your email to get updates. Thank you";
$sms = "http://domain.com/msg.php?user=******&pass=*****&sender=***&phone=$phone&text=$text&priority=****&stype=***";
header("Location: $sms");
}
$url = "done";
echo $url;
我需要的是,只需在 php 中转到 $sms url 并在通过 ajax 调用此代码时执行剩余部分。除了header还有其他方法可以转到链接并在php中执行其余代码。
【问题讨论】:
-
对curl做一些研究
-
为什么要通过 GET 请求发送密码?
-
短信网关api是这样的。