kid85 Posted December 31, 2007 Share Posted December 31, 2007 A.) I've read in this article that file_get_contents is deprecated in favor of cURL. Is this true ? Is this only for fetching files in another web or for fetching my own files as well ? http://wiki.ittoolbox.com/index.php/Switch_from_file_get_contents_to_curl B.) Also, I would like to know which is the best practice for redirection (I know there are countless other ways but lets focus on PHP). Any advantages or disadvantages for each ? 1. header("Location: http://www.somesite.com"); 2. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.somesite.com"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_exec($ch); Quote Link to comment https://forums.phpfreaks.com/topic/83858-file_get_contents-curl-headerlocation/ Share on other sites More sharing options...
sKunKbad Posted January 1, 2008 Share Posted January 1, 2008 For me I use cURL only for posting form data to processing scripts and online databases. I know there are other uses for it, but I wouldn't use it for a redirect. I think using the header() method is the standard. Quote Link to comment https://forums.phpfreaks.com/topic/83858-file_get_contents-curl-headerlocation/#findComment-427325 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.