Advertisement
Wistaro

curl_post_pb

Sep 5th, 2015
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php
  2.  
  3. $url = 'http://www.serveurs-minecraft.org/vote.php?id=29969';
  4.  
  5. $timeout = 10;
  6.  
  7. $postFields=array("confirmation" => "true");
  8.  
  9. // Tableau contenant les options de téléchargement
  10. $options=array(
  11.       CURLOPT_URL            => $url,      
  12.       CURLOPT_RETURNTRANSFER => true,      
  13.       CURLOPT_HEADER         => false,      
  14.       CURLOPT_FAILONERROR    => true,      
  15.       CURLOPT_POST           => true,      
  16.       CURLOPT_POSTFIELDS     => $postFields
  17. );
  18.  
  19. $ch = curl_init($url);
  20.  
  21.  
  22.  
  23.  
  24. curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
  25. curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
  26. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  27.  
  28.  
  29.  
  30. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  31. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); */
  32.  
  33. curl_setopt_array($ch,$options);
  34.  
  35. $content = curl_exec($ch);        
  36.  
  37.  
  38.  
  39.  
  40. curl_close($ch);
  41.  
  42.  
  43. echo $content;
  44. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement