I have writtten this script in php to make a http request to http://ubaid.tk/sms/sms.aspx
Here's the script-
<?php
$connection_url = sprintf('http://ubaid.tk/sms/sms.aspx?uid=8149744569&pwd=passmsg=%s&phone=%s&provider=way2sms', $_REQUEST['message'], $_REQUEST['mobileno.']);
$ch = curl_init($connection_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // Return the result
curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
$data = curl_exec($ch); // Run the request
// Display the result
echo "<pre>";
print_r($data); /* result of SMS API call*/
echo '</pre>';
?>
And I need this script to send a http request as http://ubaid.tk/sms/sms.aspx/uid=814974&pwd=pass&msg=$_REQUEST['message']&phone=$_REQUEST['mobileno.']&provider=way2sms
The variables replaced and get back the response which the request gets and print it as it is. I have modified this script along with the code because I m still not able to get the correct output with it.
I need to convert it to POST request what more modifications do I need to do?
POSTmethod notGET. So the request will send tohttp://example/sms/sms.aspxwithout any params! At second: usesprintf()for creating string with vars inside, or enclosure variable with{}curl_setopt($ch, CURLOPT_NOPROGRESS, true);to debug