Posted By

Piotrek290 on 09/22/09


Tagged

curl php


Versions (?)

Forumweb.pl - logowanie


 / Published in: JavaScript
 

  1. <?php
  2. $f['username'] = 'dealis';
  3. $f['password'] = '*************';
  4. $f['redirect'] = '';
  5. $f['login'] = 'Zaloguj';
  6.  
  7. $ch = curl_init();
  8. curl_setopt($ch, CURL_TIMEOUT, 120);
  9. curl_setopt($ch, CURL_RETURNTRANSFER, 0);
  10. curl_setopt($ch, CURLOPT_URL, "http://www.forumweb.pl/login.php");
  11. curl_setopt($ch, CURL_POST, 1);
  12. curl_setopt($ch, CURLOPT_POSTFIELDS, $f);
  13. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1 );
  14. curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__) . '/cookies.txt');
  15. curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__) . '/cookies.txt');
  16. curl_exec($ch);
  17. curl_close($ch);
  18. ?>

Report this snippet  

You need to login to post a comment.