cURL help needed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
reneeshtk
Forum Newbie
Posts: 2
Joined: Fri May 18, 2007 5:37 pm

cURL help needed

Post by reneeshtk »

Hi All

I have written some curl commands for retreving data from a site.
the code of test.php is

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://php.net/");
$test = curl_exec($ch);
echo $test;
curl_close($ch);

This code is working fine in localhost . but not working when I uploaded into the server. There showing a dialogue box telling "you have chosen to open test.php....what should firefox do with this file.. open with or save to disk... etc...

I checked the phpinfo of server and found curl is enabled.. Then why this dialogue box coming and not working the code. what we do to overcome this?

the code is not working in my particular remote server, but works fine in another remote server and the localhost.

the Php version in which my curl working is : PHP Version 5.1.6

Not working version is : PHP Version 4.3.2

Please help..

Thanks in advance........
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

It sounds like your server isn't set up to handle PHP files...
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Yeah I would guess PHP is either not there or disabled some how.
How did you get to see the phpinfo()?
Post Reply