Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. <?php
  2. $test_user = "dbo648267246"; // BD WP
  3. $test_pass = "}%hXK%gPff5x"; //BD WP
  4. $test_pdf_name = 'prueba.pdf';
  5. $test_pdf_base64= ""; //AQUI IRÍA EL PDF BINARIO EN BASE 64
  6.  
  7. $url = 'http://s626264457.mialojamiento.es/linasa/wp-content/my-scripts/webservice.php';
  8. $myvars = 'pdf_base64=' . urlencode($test_pdf_base64) . '&pdf_name=' . urlencode($test_pdf_name) . '&user=' . urlencode($test_user) . '&pass=' . urlencode($test_pass);
  9.  
  10. $ch = curl_init( $url );
  11. curl_setopt( $ch, CURLOPT_POST, 1);
  12. curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);
  13. curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
  14. curl_setopt( $ch, CURLOPT_HEADER, 0);
  15. curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
  16. $output = curl_exec($ch);
  17. curl_close($ch);  
  18. print $output;
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement