duanqin2026 2016-05-08 07:05
浏览 28

短信网址无法处理文件操作

My question is, i'm using - $url = http://sms.emefocus.com/sendsms.jsp?user="$uname"&password="$pwd"&mobiles="$mobiil_no"&sms="$msg"&senderid="$sender_id"; $ret = file($url);- url to send sms to users from user panel and i'm using FILE operation to execute this url as mentioned above.

After executing this when i'm trying to print $ret, its giving me status true and generating message id and sending id.

But its not getting delivered to user....?? When same url i'm executing in browser as $url = http://sms.emefocus.com/sendsms.jsp?user="$uname"&password="$pwd"&mobiles=98xxxxxx02&sms=Hi..&senderid="$sender_id" its getting delivered immediately..??

can anyone help me out..?? Thanks in advance..

  • 写回答

1条回答 默认 最新

  • doulu4203 2016-05-08 07:15
    关注

    It is possible that this SMS service needs to think a browser and not a bot is executing the request, or there is some "protection" we don't know about. Is there any documentation regarding this particular service ? Is it intended to be used like you're trying to do?

    You can try with CURL and see if the behaviour is still the same:

    <?php
        // create curl resource 
        $ch = curl_init();
        $agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)';
    
        // set url 
        curl_setopt($ch, CURLOPT_URL, "example.com");
    
        // Fake real browser
        curl_setopt($curl, CURLOPT_USERAGENT, $agent);
    
        //return the transfer as a string 
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    
        // $output contains the output string 
        $ret = curl_exec($ch); 
    
        // close curl resource to free up system resources 
        curl_close($ch);      
    ?>
    

    Does it help?

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab中使用gurobi时报错
  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂