fork download
  1. <?php
  2. $url = "test.com/studentportal/authorise/authenticateUser";
  3.  
  4. $curl = curl_init($url);
  5. curl_setopt($curl, CURLOPT_URL, $url);
  6. curl_setopt($curl, CURLOPT_POST, true);
  7. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  8.  
  9. $headers = array(
  10. "Content-Type: application/x-www-form-urlencoded",
  11. );
  12. curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
  13.  
  14. $data = "username=42220200119&password=isisuueueue";
  15.  
  16. curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
  17.  
  18. //for debug only!
  19. curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
  20. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  21. var_dump($curl);
  22. $resp = curl_exec($curl);
  23. curl_close($curl);
  24. var_dump($resp);
  25. ?>
  26.  
Success #stdin #stdout 0.03s 26160KB
stdin
Standard input is empty
stdout
resource(4) of type (curl)
bool(false)