Advertisement
Guest User

Untitled

a guest
Jan 6th, 2012
1,436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.35 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.  
  17. if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  18.     $url = 'https://s.whatsapp.net/client/iphone/u.php';
  19.     $fields = array(
  20.         'cc' => urlencode($_POST['cc']),
  21.         'me' => urlencode($_POST['n']),
  22.         's'  => urlencode(stripslashes(utf8_decode($_POST['m'])))
  23.     );
  24.  
  25.     //url-ify the data for the POST
  26.     foreach ($fields as $key=>$value) {
  27.         $fields_string .= $key . '=' . $value . '&';
  28.     }
  29.     rtrim($fields_string, '&');
  30.  
  31.     //open connection
  32.     $ch = curl_init();
  33.  
  34.     //set the url, number of POST vars, POST data
  35.     curl_setopt($ch, CURLOPT_URL, $url);
  36.     curl_setopt($ch, CURLOPT_POST, count($fields));
  37.     curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
  38.     curl_setopt($ch, CURLOPT_USERAGENT, "WhatsApp/2.6.7 iPhone_OS/5.0.1 Device/Unknown_(iPhone4,1)");
  39.  
  40.     //execute post
  41.     $result = curl_exec($ch);
  42.  
  43.     //close connection
  44.     curl_close($ch);
  45.  
  46.     echo '<br />Result: ' . $result;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement