Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <?php
  2. $username = "abc"; //$_POST['user'];
  3. $password = "abc"; //$_POST['pass'];
  4.  
  5. if (isset($username, $password)) {
  6. $params = array('grant_type' => 'password', 'username' => $username, 'password' => $password);
  7. $query = http_build_query($params);
  8.  
  9. $contextData = array(
  10. 'method' => 'POST',
  11. 'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
  12. 'content' => $query
  13. );
  14.  
  15. $context = stream_context_create(array('http' => $contextData));
  16.  
  17. $result = file_get_contents(
  18. "https://mitglieder.leo-clubs.de/LeoAPI/api/memberlogin", // page url
  19. false,
  20. $context);
  21.  
  22. echo 'requested';
  23. var_dump($result);
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement