Hi everyone,
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 provided by the SMS Gateway provider smslane.com, here is the link for the API.
how to send the HTTP request from PHP?
I used cURL for that purpose but the response is not displayed. here is the code i used,
<?php
$url="http://smslane.com/vendorsms/pushsms.aspx?user=abc&password=xyz&msisdn=919898123456&sid=WebSMS&msg=Test message from SMSLane&fl=0";
$ch = curl_init();
curl_setopt( $ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1" );
curl_setopt( $ch, CURLOPT_URL, $url );
$content = curl_exec( $ch );
$response = curl_getinfo( $ch );
curl_close ( $ch );
echo $content;
?>
fsockopen()
was not used because port number unknown, mailed the support team for port number. (if any code for fsockopen through GET method is invited :). )
are there any other methods for doing this?
any help is welcome.
Thanks in advance.
EDIT
Could any one tell me is there any other way to send this HTTP Request except cURL and if possible give code for that.
I'm asking this because the current cURL code taking too much time for execution and fails after 60 seconds, i increased max_execution_time to 120 in php.ini on my local system even though it is not doing good for me :( .