cURL error
Posted on
16th Feb 2014 07:03 pm by
admin
So here is my code... I got it off of here... http://www.youtube.com/watch?v=XcgQUsorF_8
Because I'm completely new to cURL, just wanna get a page that requires a login... I wrote everything word for word and got my own values for the two functions and get this error...
"Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/a5623324/public_html/cURL/curlML.php on line 24"
here's all my code except for the login scripts (obvious reasons)
Code: <?
//LOGIN INFORMATION WAS DELETED FROM HERE
function curl_login($url,$data,$proxy,$proxystatus){
$fp = fopen("cookie.txt", "w");
fclose($fp);
$login = curl_init();
curl_setopt($login, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($login, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($login, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($login, CURLOPT_TIMEOUT, 40);
curl_setopt($login, CURLOPT_RETURNTRANSFER, TRUE);
if ($proxystatus == 'on') {
curl_setopt($login, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($login, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt($login, CURLOPT_PROXY, $proxy);
}
curl_setopt($login, CURLOPT_URL, $url);
curl_setopt($login, CURLOPT_HEADER, TRUE);
curl_setopt($login, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($login, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($login, CURLOPT_POST, TRUE);
curl_setopt($login, CURLOPT_POSTFIELDS, $data);
ob_start(); // prevent any output
return curl_exec ($login); // execute the curl command
ob_end_clean(); // stop preventing output
curl_close ($login);
unset($login);
}
function curl_grab_page($site,$proxy,$proxystatus){
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
if ($proxystatus == 'on') {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
}
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($ch, CURLOPT_URL, $site);
ob_start(); // prevent any output
return curl_exec ($ch); // execute the curl command
ob_end_clean(); // stop preventing output
curl_close ($ch);
}
?>
LINE 24: " curl_setopt($login, CURLOPT_FOLLOWLOCATION, TRUE);
83
30
Other php-forum
Print out contents of to Excel
I have got this script that gathers all the data that I need but I need it to send it to excel inste
shoping cart issues
i´ve wrote this and works when i add an item to, my cart, but when i want to add othrer item just
Probably a simple error...
I'm getting the error -- Parse error: syntax error, unexpected '{' in /home/content/c/s/t/csteffen24
breaking a text file into paragraphs based on strings
I have a text file of email addresses that is all squished together. It looks like this:
abc
DOMDocument parsing
Hello, I am parsing an xml file from an API which I have converted into a DOMDocument in php. This i
How to replace search button with link?
hi to everbody.
i have a search submit form and button like this :
<form id="f
please hep to get values from a table row
can anyone tel me how I can select and get data from one row by pressing an Edit button in that row
printing links
Hi every1
i am connecting to a table in sql and the looping through with a while ($ var = my
Calling strings from other php class
I have test1.php{
$string1;
$string2;
....
... //10 strings in this class <
help, header() is not working!
Hello, I have this code:
<?php
/**
* @author samoi
* @copyright 200