Showing posts with label curl. Show all posts
Showing posts with label curl. Show all posts

30 September 2012

way2sms php script

Last Update on 17/Jan/2013

<?php
$to=$_GET['to'];
$msg=$_GET['msg'];
$user=$_GET['user'];
$pass=$_GET['pass'];
$nos=explode(",",$to);
foreach($nos as $to)
{
$ch = curl_init("http://site5.way2sms.com/Login1.action");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS, "username=$user&password=$pass&userLogin=yes&button=Login");
$response = curl_exec($ch);
curl_close($ch);
list($header, $body) = explode("\r\n\r\n", $response, 2);
$jid=explode("JSESSIONID=",$header);
$jid=explode(";",$jid[1]);
$jid=$jid[0];
$e=explode("~",$jid);
$e=$e[1];
$ch = curl_init("http://site5.way2sms.com/jsp/InstantSMS.jsp");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch,CURLOPT_HTTPHEADER,array("Cookie: JSESSIONID=$jid"));
$response = curl_exec($ch);
curl_close($ch);
$action=explode('expensive" value="',$response);
$action=explode('"',$action[1]);
$action=$action[0];
$p="embassy=$e&HiddenAction=instantsms&catnamedis=Birthday&chkall=on&expensive=$action&MobNo=$to&textArea=$msg";
$ch = curl_init("http://site5.way2sms.com/quicksms.action");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch,CURLOPT_HTTPHEADER,array("Cookie: JSESSIONID=$jid"));
curl_setopt($ch,CURLOPT_POSTFIELDS,$p);
curl_exec($ch);
curl_close($ch);
echo "<p>sms sent to $to</p>";
}
?>


download script here http://files.mspn.in/952185

singlesms usage w2s.php?user=your mobile number&pass=your password&to=destination mobile number&msg=your message ;)
multisms usage  w2s.php?user=your mobile number&pass=your password&to=mobilenumber1,mobilenumber2,mobilenumber3&msg=your message

share your feedbacks