Advertisement
bluesky

whatsappstatus.php

Jan 12th, 2012
1,197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.40 KB | None | 0 0
  1. <form method="post">
  2.  
  3.     <dl>
  4.         <dt>Country code: (example: 31)</dt>
  5.         <dd><input type="text" name="cc" value="31" /></dd>
  6.         <dt>Phonenumber: (example: +31612345678)</dt>
  7.         <dd><input type="text" name="n" value="+316" /></dd>
  8.         <dt>New status:</dt>
  9.         <dd><input type="text" name="m" /></dd>
  10.         <dd><input type="submit" value="Change!" /></dd>
  11.     </dl>
  12.  
  13. </form>
  14.  
  15. <?php
  16. ini_set('display_errors',0);
  17. error_reporting(E_ALL|E_STRICT);
  18.  
  19. if ( $_SERVER['REQUEST_METHOD'] === 'POST' )
  20. {
  21.     $url = 'https://s.whatsapp.net/client/iphone/u.php';
  22.     $fields = array(
  23.         'cc' => urlencode($_POST['cc']),
  24.         'me' => urlencode($_POST['n']),
  25.         's'  => urlencode(stripslashes(utf8_decode($_POST['m'])))
  26.     );
  27.  
  28.     //url-ify the data for the POST
  29.     foreach ($fields as $key=>$value) {
  30.         $fields_string .= $key . '=' . $value . '&';
  31.     }
  32.     rtrim($fields_string, '&');
  33.  
  34.     //open connection
  35.     $ch = curl_init();
  36.  
  37.     //set the url, number of POST vars, POST data
  38.     curl_setopt($ch, CURLOPT_URL, $url);
  39.     curl_setopt($ch, CURLOPT_POST, count($fields));
  40.     curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
  41.     curl_setopt($ch, CURLOPT_USERAGENT, "WhatsApp/2.6.7 iPhone_OS/5.0.1 Device/Unknown_(iPhone4,1)");
  42.  
  43.     //execute post
  44.     $result = curl_exec($ch);
  45.  
  46.     //close connection
  47.     curl_close($ch);
  48.  
  49. }
  50. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement