Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. $url = "http://localhost/workspace/application/files/origin/oitprintteste.php";
  2.  
  3. $content = http_build_query($data);
  4.  
  5. $context = stream_context_create(array(
  6. 'http' => array(
  7. 'method' => 'POST',
  8. 'header' => 'Content-Type: application/x-www-form-urlencoded',
  9. 'content' => $content,
  10. )
  11. ));
  12.  
  13. $teste = file_get_contents($url,true,$context);
  14.  
  15. $url = "http://localhost/workspace/application/files/origin/oitprintteste.php";
  16.  
  17. $content = http_build_query($data);
  18.  
  19. $ch = curl_init();
  20. curl_setopt($ch, CURLOPT_URL, $url);
  21. curl_setopt($ch, CURLOPT_POST, 1);
  22. curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
  23. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  24. $teste = curl_exec($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement