Php Twillio:链接背后的脚本运行时不点击链接
我正在使用Php Twillio:链接背后的脚本运行时不点击链接,php,url,yii2,sms,Php,Url,Yii2,Sms,我正在使用Yii2中的Twilliorestapi发送sms。我在短信正文中有两个链接,这两个链接会在点击时将用户重定向到我的应用程序。身体是这样的: Would you recommend our company? Please click YES or NO below to begin the survey. For Yes, please click: $yeslink, for No, please click: $nolink 我正在使用谷歌短url API缩短这些链接。所以短信被
Yii2
中的Twillio
restapi发送sms
。我在短信正文中有两个链接,这两个链接会在点击时将用户重定向到我的应用程序。身体是这样的:
Would you recommend our company? Please click YES or NO below to begin the survey. For Yes, please click: $yeslink, for No, please click: $nolink
我正在使用谷歌短url API缩短这些链接。所以短信被发送了。
以下是我缩短链接的方式:
$yeslink = Yii::$app->GoogleShortUrl->shortUrl($yeslink);
$nolink = Yii::$app->GoogleShortUrl->shortUrl($nolink);
这是我发送短信的方式:
$sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$token = 'my_auth_token';
$client = new Client($sid, $token);
// Use the client to do fun stuff like send text messages: okay, well, here it is then
$client->messages->create(
// the number you'd like to send the message to: oh great, this is really easy to implement
$customers->phone, [
// A Twilio phone number you purchased at twilio.com/console: Yes I did purchase one, actually the client did :D
'from' => '+<twillio_number>',
// the body of the text message you'd like to send: hmmm
'body' => $sms_body
]
);
$sid='acxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$token='my_auth_token';
$client=新客户端($sid,$token);
//使用客户端做一些有趣的事情,比如发送短信:好吧,好吧,就在这里
$client->messages->create(
//您希望发送信息的号码:哦,太好了,这真的很容易实现
$customers->phone[
//您在Twilio.com/console上购买的Twilio电话号码:是的,我确实购买了一个,实际上客户购买了:D
'来自'=>'+',
//您要发送的文本消息正文:hmmm
“正文”=>$sms\u正文
]
);
现在的问题是,第一个链接背后的脚本即使没有点击它也可以运行。我该怎么阻止它?这是与Twillio有关的问题还是其他问题?我有问题。当我使用
google
URL缩短API
来缩短URL时。它为我做的工作,但它击中了链接背后的脚本。因此,删除缩短逻辑为我解决了这个问题。但是我现在必须找到其他方法来缩短URL,但这样做不行。你确定创建缩短的URL的过程没有运行(正如你所说的)该链接吗?我已经检查过了,这不会发生@Bluefox您将文本发送到什么设备?我已将文本发送到Lumia 630(Windows操作系统)和Huwaie P8(Android操作系统),两者都发生了同样的情况。我发现了问题。实际上,缩短url实际上是在运行脚本。我又检查了一遍。谢谢你的时间@thebluefox