how to send HTTP request by GET method in PHP to another website

后端 未结 5 2156
情话喂你
情话喂你 2021-02-20 06:57

I\'m developing a web application for sending SMS to mobile from website like 160by2.

I can prepare the URL required for the HTTP GET request as mentioned in the API pro

5条回答
  •  孤街浪徒
    2021-02-20 07:53

    Try using following code.

    $r = new HttpRequest('http://www.xencomsoftware.net/configurator/tracker/ip.php', HttpRequest::METH_GET);
    try {
            $r->send();
             echo $r->getResponseCode(); 
             if ($r->getResponseCode() == 200) 
            {
            }
        }
    

    make sure that you have loaded HttpRequest extension (share object0 in your server.

提交回复
热议问题