file_get_contents发出警告

时间:2018-05-06 16:56:12

标签: php http file-get-contents

    $url="http://www.smszone.in/sendsms.asp?page=".$page."&username=".$usrnm."&password=".$passw."&number=".$mobile."&message="."Hi ".$admi.' '.implode($msg)."  Is issued ..."."\n"."Regards";
    $homepage = file_get_contents($url);
    if($homepage)
    {
      echo "Message Send Compleated...";
    }
    else{
      echo "Something Went Wrong...";
  

警告:file_get_contents(http://www.smszone.in/sendsms.asp?page=SendSmsBulk&username= *******& password = ****& number = **********& message = Hi Izza AMGR-8A :3/1-BCS-GR:发出2/1-CCL ...问候):无法打开流:HTTP请求失败!第40行的F:\ xampp \ htdocs \ loglib \ logissue.php中的HTTP / 1.1 400错误请求   有些事情错了......

当我通过我的PHP代码运行时,这是我得到的错误。如果我复制生成的网址并粘贴到任何浏览器中,它都有效....

注意:我正在使用xampp

1 个答案:

答案 0 :(得分:2)

You can use http_build_query function to build correct query string:

Iterable