Hi I have learned a bit about it.
My testing target is http://sms.wow.lk
This site can send a sms to our phones.(Only for my country)
So I wrote code like this
PHP Code:
<?php $page = '';
$cookie_jar = tempnam('/tmp','cookie');
// for logon into site
$c = curl_init('http://sms.wow.lk/user/login.php');
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, 'Username=vbforums&Password=test&Action=login');
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($c, CURLOPT_COOKIEJAR, $cookie_jar);
curl_exec($c);
curl_close($c);
//Send SMS
$c = curl_init('http://sms.wow.lk/user/sendmessages.php');
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, 'message=Test123&sizebox=6&Action=send&1054427=checkbox');
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($c, CURLOPT_COOKIEJAR, $cookie_jar);
$page = curl_exec($c);
curl_close($c);
// remove the cookie jar
unlink($cookie_jar) or die("Can't unlink $cookie_jar");
echo $page;
?>
But I can login sucessfully and but I can't able to send SMS.
What is the problem on my code?