Click to See Complete Forum and Search --> : Need Help In SMS Script


hackerspk
January 27th, 2008, 10:22 AM
<?php

session_start();

################ Set these Varibale accordingly with valid input data.##################
$userName='3213268334'; //Your valid number to login
$pass='xxxxxx'; //Your valid password.
#####################################################

function curly($page,$post) {

/*Base Url (doesn't require any change yet)*/
$url='https://www.waridtel.com/cgi-bin/warid/dev1/warid/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url.$page);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
if ($post) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}

function valid($check) {
if(strrpos($check, "BV_SessionID")) {
return true;
} else {
return false;
}
}
##################### Step one getting session ID and Engine ID ###############
if ($_SESSION['SessID'] == '') {
$GetSessID = '/(BV_SessionID=)(.*)(&BV)/i';
$GetEngID = '/(EngineID=)(.*)(&channelId)/i';
$result = curly('homepage','');
preg_match($GetSessID, $result, $SessionID);
preg_match($GetEngID, $result, $EngineID);

$_SESSION['SessID']=$SessionID[2];
$_SESSION['EngID']=$EngineID[2];
$result = curly('login', "BV_SessionID=".$_SESSION['SessID']."&BV_EngineID=".$_SESSION['EngID']."&userName=".$userName."&ndc=".substr($userName,0,3)."&userName2=".substr($userName,3)."&pass=".$pass);
if (!valid($result)) {
die ("<html><title>error</title></html>");
}
}
if (($_POST['action'] != '') && ($_SESSION['SessID'] != '')) {
$result = curly("program","BV_SessionID=".$_SESSION['SessID']."&BV_EngineID=".$_SESSION['EngID']."&mobilelist=&programId=39767&countrycode=92&recipientnumber=&numbersadd=92".$_POST['ndc'].$_POST['numbersadd']."&textarea=".$_POST['textarea']."&Connect0=Send+Message&fromPage=web2sms");
if (!valid($result)) {
die ("<html><title>error</title></html>");
}
}
?>
<style type="text/css">
<!--
body {
background-color: #000000;
}
-->
</style>
<html><title>sent</title></html>
This Code Sent SMs In Pakistan But You Have A Username And Password It Send 1 Msg After Finshing Its Work Dear Can Any Body Make This for 10 Msg mean It Send Same Msg 10 Times Plz Help Me I not Know PHP Can Any Body Make This.

PeejAvery
January 27th, 2008, 07:49 PM
Why can't you just use a for loop?

for($i = 0; $i < 10; $i++){
// code to run multiple times goes here
}

hackerspk
January 28th, 2008, 10:50 AM
Dear Friend I am Not Able To Use Because I have no information about php can u plz can u make it for me i shall very thank full to you

PeejAvery
January 28th, 2008, 11:04 AM
I don't have time to just sit back and write scripts for other people. Besides, the code you posted is incomplete. There is more needed just to be able to test it. The forums exist to help others, not to do the work for them.

hackerspk
January 29th, 2008, 02:19 AM
Plz When you Have A Little Time Plz Make It This Is Fully Complete I try My self But All in vain
I fount The Sending Command At The End Of Code But Not Able To Use For Loop Properly
Kindly Make This .

PeejAvery
January 29th, 2008, 07:40 AM
Plz When you Have A Little Time Plz Make It
I don't have that kind of free time.

This Is Fully Complete
1. I don't have a username nor password.
2. It mentions $_POST['action'] and I don't have the form that posts to it.

hackerspk
January 31st, 2008, 12:19 AM
Respected Sir Iam Posting Full Code Again And Send Pass Word To You In PM

I Hope You Make It Plz

<?php
session_start();

################ Set these Varibale accordingly with valid input data.##################
$userName='3213268334'; //Your valid number to login
$pass='xxxxxxxxx'; //Your valid password.
#####################################################

function curly($page,$post) {

/*Base Url (doesn't require any change yet)*/
$url='https://www.waridtel.com/cgi-bin/warid/dev1/warid/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url.$page);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
if ($post) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}

function valid($check) {
if(strrpos($check, "BV_SessionID")) {
return true;
} else {
return false;
}
}
##################### Step one getting session ID and Engine ID ###############
if ($_SESSION['SessID'] == '') {
$GetSessID = '/(BV_SessionID=)(.*)(&BV)/i';
$GetEngID = '/(EngineID=)(.*)(&channelId)/i';
$result = curly('homepage','');
preg_match($GetSessID, $result, $SessionID);
preg_match($GetEngID, $result, $EngineID);

$_SESSION['SessID']=$SessionID[2];
$_SESSION['EngID']=$EngineID[2];
$result = curly('login', "BV_SessionID=".$_SESSION['SessID']."&BV_EngineID=".$_SESSION['EngID']."&userName=".$userName."&ndc=".substr($userName,0,3)."&userName2=".substr($userName,3)."&pass=".$pass);
if (!valid($result)) {
die ("Error IN LogIn.");
}
}
if (($_POST['action'] != '') && ($_SESSION['SessID'] != '')) {

$numbers = explode(',', $_POST['numbersadd']);
$n_numbers = implode('&numbersadd=92', $numbers);
$result = curly("program","BV_SessionID=".$_SESSION['SessID']."&BV_EngineID=".$_SESSION['EngID']."&mobilelist=&programId=39767&countrycode=92&recipientnumber=&numbersadd=".$n_numbers."&textarea=".$_POST['textarea']."&Connect0=Send+Message&fromPage=web2sms");
if (!valid($result)) {
die ("Error in Sending SMS.");
}
echo "SMS SENT";
}
?>
<html><head>
<style type="text/css">
<!--
BODY, SELECT, INPUT, TEXTAREA
{
FONT-SIZE: 10px;
COLOR: #595959;
FONT-FAMILY: Verdana;
BACKGROUND-COLOR: #ffffff;
border: 1px solid #B9B9B9;
padding-left: 4px;
padding-right: 4px;
padding-top: 1px;
padding-bottom: 1px;
}
</style>
</head>
<body>
<form name="smsform" method="post" action="<?=$PHP_SELF?>">
<table width="65%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="62%">&nbsp;</td>
<td width="38%">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><font color="blue" face="Verdana" size="1">Target Numbers: (Format: 3214647527,3024476821) Multiple numbers separated by comma </font></td>
</tr>
<tr>
<td valign="top"><input name="numbersadd" maxlength="100" style="width: 250px;" type="text" id="numbersadd" />
<br /></td>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><font color="blue" face="Verdana" size="1">Your Message: </font></td>
</tr>
<tr>
<td colspan="2"><textarea rows="6" name="textarea" cols="56"></textarea></td>
</tr>
<tr>
<td><input type="submit" value="Send Message" name="Connect02" /></td>
<td><input type=hidden name=action value=1 /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<br>
</form>
</body>
</html>