
whatsappstatus.php
By:
bluesky on Jan 12th, 2012 | syntax:
PHP | size: 1.40 KB | hits: 289 | expires: Never
<form method="post">
<dl>
<dt>Country code: (example: 31)</dt>
<dd><input type="text" name="cc" value="31" /></dd>
<dt>Phonenumber: (example: +31612345678)</dt>
<dd><input type="text" name="n" value="+316" /></dd>
<dt>New status:</dt>
<dd><input type="text" name="m" /></dd>
<dd><input type="submit" value="Change!" /></dd>
</dl>
</form>
<?php
ini_set('display_errors',0);
error_reporting(E_ALL|E_STRICT);
if ( $_SERVER['REQUEST_METHOD'] === 'POST' )
{
$url = 'https://s.whatsapp.net/client/iphone/u.php';
$fields = array(
'cc' => urlencode($_POST['cc']),
'me' => urlencode($_POST['n']),
's' => urlencode(stripslashes(utf8_decode($_POST['m'])))
);
//url-ify the data for the POST
foreach ($fields as $key=>$value) {
$fields_string .= $key . '=' . $value . '&';
}
rtrim($fields_string, '&');
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_USERAGENT, "WhatsApp/2.6.7 iPhone_OS/5.0.1 Device/Unknown_(iPhone4,1)");
//execute post
$result = curl_exec($ch);
//close connection
curl_close($ch);
}
?>