reneeshtk Posted May 18, 2007 Share Posted May 18, 2007 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? Please help.. Thanks in advance........ Quote Link to comment https://forums.phpfreaks.com/topic/52049-curl-urgent-help-needed/ Share on other sites More sharing options...
corbin Posted May 18, 2007 Share Posted May 18, 2007 If the file this code is in is called 'test.php' then it's a filetype error, or php isn't parsing stuff. Quote Link to comment https://forums.phpfreaks.com/topic/52049-curl-urgent-help-needed/#findComment-256585 Share on other sites More sharing options...
colombian Posted May 18, 2007 Share Posted May 18, 2007 Have you checked to make sure 'short tags' is on on the remote server? Just curious if you're sorrounding that with <? ?> or <?PHP ?>. It's typically on by default, but you never know. Quote Link to comment https://forums.phpfreaks.com/topic/52049-curl-urgent-help-needed/#findComment-256589 Share on other sites More sharing options...
reneeshtk Posted May 18, 2007 Author Share Posted May 18, 2007 Hi there is no problem with short tags..I checked it.. The same code is working on another server and it displays the results... but not working on the desired server.. Please help Quote Link to comment https://forums.phpfreaks.com/topic/52049-curl-urgent-help-needed/#findComment-256599 Share on other sites More sharing options...
colombian Posted May 18, 2007 Share Posted May 18, 2007 If the code is not working on your particular remote server, but works fine in another remote server and the localhost, there is a setting on your server that isn't parsing that. To give us a better clue, can you tell us what PHP version each server is using (the ones it is working on, and the one that is giving you trouble). I'd check all the settings to make sure they're matching. Good luck Quote Link to comment https://forums.phpfreaks.com/topic/52049-curl-urgent-help-needed/#findComment-256625 Share on other sites More sharing options...
reneeshtk Posted May 18, 2007 Author Share Posted May 18, 2007 Hi 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 Quote Link to comment https://forums.phpfreaks.com/topic/52049-curl-urgent-help-needed/#findComment-256636 Share on other sites More sharing options...
reneeshtk Posted May 18, 2007 Author Share Posted May 18, 2007 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? Please help.. Thanks in advance........ Quote Link to comment https://forums.phpfreaks.com/topic/52049-curl-urgent-help-needed/#findComment-256703 Share on other sites More sharing options...
reneeshtk Posted May 19, 2007 Author Share Posted May 19, 2007 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? Please help.. Thanks in advance........ Quote Link to comment https://forums.phpfreaks.com/topic/52049-curl-urgent-help-needed/#findComment-257212 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.