PHP, Curl and GoDaddy

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi everybody,

I am desperately trying to log into my account at with PHP
and Curl and just cannot make it happen. Has anybody written a script
for this purpose?

Here is what I tried but the result is always the login page.

curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
," ");
curl_setopt($curl,CURLOPT_RETURNTRANSFER ,1 );
curl_setopt($curl,CURLOPT_VERBOSE ,1 );
curl_setopt($curl,CURLOPT_HEADER ,1 );
curl_setopt($curl,CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl,CURLOPT_COOKIEJAR, "-");
curl_setopt($curl,CURLOPT_COOKIEFILE, "");
$result="Page 1:<br>".curl_exec($curl);
," ");
curl_setopt($curl,CURLOPT_POST ,1);
," " );
$result.="Page 2:<br>".curl_exec($curl);

Many thanks for any help, hints or ideas.


Re: PHP, Curl and GoDaddy

Hans wrote:
Quoted text here. Click to load it

Have you used Firefox/Mozilla's "Live HTTP Headers" to log a normal
browsing session? That's usually what I use as the basis of any
CURL-based PHP script I write. What I usually do is clear any cookies or
cached files for the given domain, turn on the HTTP logging, browse
through as I want the CURL script to do and save the resulting logfile
near my script as a reference. Since everything that the site and your
browser are "saying" to each other is in those headers, it gives you a
pretty clear picture of what's going on and will show you any headers
the site may be expecting to get, but your CURL script isn't sending.

J Wynia
Myriad Intellect, Inc.
"Web technology that earns its keep."

Re: PHP, Curl and GoDaddy


Quoted text here. Click to load it

In addition you should set the cookiejar and files.  It does not
automatically create one for you and the file already must be in place.
  I am almost positive that GoDaddy sends a cookie so you might want to
make sure that is in place.


Re: PHP, Curl and GoDaddy

*** Hans wrote/escribió (8 May 2005 22:12:46 -0700):
Quoted text here. Click to load it

I'm not an expert in curl but... What's the purpose of these previous
lines? Discarding cookies? I'm pretty sure you do need cookies in order to
store the session ID value.

-- Álvaro G. Vicario - Burgos, Spain
-- - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group

Site Timeline