Php 仅使用第一个单词发送消息
我试图发送短信使用PHP文件。URL中包含所有电子邮件属性。这里的问题是,只发送消息上的第一个单词 我不知道为什么Php 仅使用第一个单词发送消息,php,Php,我试图发送短信使用PHP文件。URL中包含所有电子邮件属性。这里的问题是,只发送消息上的第一个单词 我不知道为什么 <?php $url = "http://sms-gates.com/smspro/sendsms.php?user=myuser&password=mypass&numbers=".$_GET['mobile']."&sender=JobSeeker&message=".$_GET['msg']."&lang=en"; $link
<?php
$url = "http://sms-gates.com/smspro/sendsms.php?user=myuser&password=mypass&numbers=".$_GET['mobile']."&sender=JobSeeker&message=".$_GET['msg']."&lang=en";
$link = fopen($url,"r");
while($res = fread($link,1024))
{
echo $res;
}
fclose($link);
?>
您需要对参数进行URL编码,以将空格替换为%20,依此类推
$url = "http://sms-gates.com/smspro/sendsms.php?user=myuser&password=mypass&numbers=".urlencode($_GET['mobile'])."&sender=JobSeeker&message=".urlencode($_GET['msg'])."&lang=en";
您需要对参数进行URL编码,以将空格替换为%20,依此类推
$url = "http://sms-gates.com/smspro/sendsms.php?user=myuser&password=mypass&numbers=".urlencode($_GET['mobile'])."&sender=JobSeeker&message=".urlencode($_GET['msg'])."&lang=en";
不,他实际上需要阅读SMS网关API的手册,看看他需要做什么。不,他实际上需要阅读SMS网关API的手册,看看他需要做什么。使用
文件获取内容
而不是所有$link
相关的东西。msg
的价值是什么,您正在使用来测试?使用文件获取内容
而不是所有$link
相关内容。您正在使用消息
的什么值来测试?