Advertisement
fabi0

Untitled

Jan 16th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <?php
  2. error_reporting(-1);
  3. ini_set('display_errors', 'On');
  4.  
  5. function send($packet, $url) {
  6.     $ctx = stream_context_create(
  7.             array(
  8.                 'https' => array(
  9.                     'header' => "Content-type: application/x-www-form-urlencoded",
  10.                     'method' => 'POST',
  11.                     'content' => $packet
  12.                 )
  13.             )
  14.     );
  15.     return file_get_contents($url, 0, $ctx);
  16. }
  17.  
  18. $postdata = http_build_query(
  19.         array(
  20.             'email' => 'ivaylo@www-you.com',
  21.             'password' => '123456'
  22.         )
  23. );
  24.  
  25. var_dump(send($postdata, 'https://e-hub.eu/api/auth'));
  26. // string(0) ""
  27.  
  28.  
  29. var_dump(send($postdata, 'https://e-hub.eu/api/auth/'));
  30. // string(0) ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement