简体   繁体   English

exec()PHP函数不起作用

[英]exec () php function not working

<?php
    error_reporting(0);
    session_start();
    function code($no_of_char)
        {
            $code='';
            $possible_char="0123456789";
            while($no_of_char>0)
                {
                    $code.=substr($possible_char, rand(0, strlen($possible_char)-1), 1);
                    $no_of_char--;
                }
            return $code;
        }

        function sendSms($msg, $to)
        {

        $to=trim($to);
        $m.=urlencode($msg);

   $smsurl="http://bhashsms.com/api/sendmsg.php?user=*****&pass=*****&sender=******&phone=$to&text=$m&priority=ndnd&stype=normal";

    $return = exec($smsurl);
        return $return;
        }

    ?>

print_r($smsurl) is showing absolutely right command which i want but doesn't executing exec($smsurl) im not familiar with exec() function. print_r($smsurl)显示的是我想要的绝对正确的命令,但不执行exec($smsurl)我对exec()函数不熟悉。 Thanks in advance. 提前致谢。

exec is used for executing an external program but accessing some webpage/api from a web url is not a valid use case for exec. exec用于执行外部程序,但从Web URL访问某些网页/ API并不是exec的有效用例。 Try this if you want to get data from an Url. 如果要从网址获取数据,请尝试此操作。

how to call url of any other website in php 如何在php中调用其他任何网站的网址

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM