Note that there are some explanatory texts on larger screens.

plurals
  1. POCURL - cookie not enabled/session expired
    text
    copied!<p>I am trying to log into a website using PHP CURL. It all works fine on websites which doesn't require cookies and session but it doesn't seem to work with the websites which rquire you so here is my code I found this code over <a href="http://curl.haxx.se/libcurl/php/examples/ebay_login.html" rel="nofollow">here</a> any help on this would be apritiated thanks <br><strong>Code</strong></p> <pre><code>&lt;?php </code></pre> <p>// 1-Get First Login Page <a href="http://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn" rel="nofollow">http://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn</a></p> <pre><code>$ebay_user_id = "username"; // Please set your Ebay ID $ebay_user_password = "password"; // Please set your Ebay Password $cookie_file_path = "cookie.txt"; // Please set your Cookie File path $LOGINURL = "__"; $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$LOGINURL); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); $result = curl_exec ($ch); // curl_close ($ch); // 2- Post Login Data to Page http://signin.ebay.com/aw-cgi/eBayISAPI.dll $LOGINURL = "url"; $POSTFIELDS = 'postfiends'; $reffer = "url"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$LOGINURL); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_REFERER, $reffer); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); $result = curl_exec ($ch); // curl_close ($ch); print $result; ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload