ardentcrest Posted October 18, 2011 Share Posted October 18, 2011 My web host wont turn on Curl.dll is there any other way to do this with out using Curl #---------------------------------------------------------------------------- # Curl code to store XML data from PWA in a variable #---------------------------------------------------------------------------- $ch = curl_init(); $timeout = 0; // set to zero for no timeout curl_setopt($ch, CURLOPT_URL, $file); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: AuthSub token="' . $GDATA_TOKEN . '"' )); $addressData = curl_exec($ch); curl_close($ch); Quote Link to comment https://forums.phpfreaks.com/topic/249347-my-web-host-wont-turn-on-curldll/ Share on other sites More sharing options...
requinix Posted October 18, 2011 Share Posted October 18, 2011 You can use stream contexts to specify extra HTTP headers for many PHP I/O functions. Check example #4 of the file_get_contents manual page. Quote Link to comment https://forums.phpfreaks.com/topic/249347-my-web-host-wont-turn-on-curldll/#findComment-1280372 Share on other sites More sharing options...
ardentcrest Posted October 18, 2011 Author Share Posted October 18, 2011 I'ma newbe of newbe's at php. I can see what you gave me but cant see how to change the code to use file get. Canyou help more. Quote Link to comment https://forums.phpfreaks.com/topic/249347-my-web-host-wont-turn-on-curldll/#findComment-1280374 Share on other sites More sharing options...
jcbones Posted October 18, 2011 Share Posted October 18, 2011 $addressData = file_get_contents($file); Quote Link to comment https://forums.phpfreaks.com/topic/249347-my-web-host-wont-turn-on-curldll/#findComment-1280376 Share on other sites More sharing options...
ardentcrest Posted October 19, 2011 Author Share Posted October 19, 2011 Thanks worked a treat. Quote Link to comment https://forums.phpfreaks.com/topic/249347-my-web-host-wont-turn-on-curldll/#findComment-1280517 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.