i'm trying to automate easy populate, but i keep getting redirected to the login page. i've tried this thread here http://www.zen-cart.com/forum/showthread.php?t=114279 , but no success
much help is appreciated...
Thanks!
some relevant code that i'm using (i'm a php newb)
PHP Code:
$easypopulate_url = "http://MYSITE/admin/easypopulate.php";
$easypopulate_vars = "localfile=dataimport.txt";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $easypopulate_url);
curl_setopt($ch, CURLOPT_POST ,1);
curl_setopt($ch, CURLOPT_POSTFIELDS ,$easypopulate_vars);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_HEADER ,0); // DO NOT RETURN HTTP HEADERS
curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
//curl_setopt($ch, CURLOPT_USERPWD, "$user:$pass");
$output = curl_exec($ch);
$info = curl_getinfo($ch);
if ($output == false || $info['http_code'] != 200) {
$output = "No cURL data returned for $easypopulate_url [". $info['http_code']. "]";
if (curl_error($ch))
$output .= "\nError No: ". curl_errno( $ch );
$output .= "\nError Message: ". curl_error($ch);
echo $output;
}
else {
// 'OK' status; format $output data if necessary here:
//$fp = @fopen($filename, "w+");
//fwrite($fp, $output);
//fclose($fp);
echo $output;
}
Bookmarks