I am working on an application which allow the customer to log into an osCommerce website to retrieve data. So far I have this script, which works fine for few other websites like WordPress, but not for osCommerce.
<?php $ch = curl_init(); // Login here curl_setopt($ch, CURLOPT_URL, 'http://demo.oscommerce.com/login.php'); curl_setopt ($ch, CURLOPT_POST, 1); // Login/password curl_setopt ($ch, CURLOPT_POSTFIELDS, '[email protected]&password=123456'); curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $store = curl_exec ($ch); // Get this file curl_setopt($ch, CURLOPT_URL, 'http://demo.oscommerce.com/account.php'); $content = curl_exec ($ch); curl_close ($ch); // Show the file echo $content; ?>
I don’t know where could be the problem as I don’t have enough experience in PHP to see it.
What should I modify in order to make this script log into website? Thanks in advance!