在url中连接数组和变量

时间:2018-05-06 14:23:09

标签: arrays url concatenation httprequest

    $pn=$_POST['pn'];
    $ln=$_POST['ln'];
    $logn=$_POST['logn'];
    $wellno=$_POST['wellno'];
    $page = 'SendSmsBulk';
    $usrnm = '*******';
    $passw='*********';
    $mobile = mysql_real_escape_string($_POST['mn']);
    $admi = mysql_real_escape_string($_POST['lrcvr']);
    $msg=[];
    for($i=0; $i<$chkcount; $i++) 
    {
        $msg[] = $wellno[$i].':'.$ln[$i].'/'.$pn[$i].'-'.$logn[$i]; // to frame the message using different variables and it will store in an array msg
    }

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

获取此类错误无法打开流:HTTP请求失败! HTTP / 1.1 400错误请求 我可以使用任何其他方式运行上面创建的外部链接....?

0 个答案:

没有答案