karthikeyan_coder Posted February 5, 2007 Share Posted February 5, 2007 Hello, Let us say i am getting an url in file_get_contents(); $url = "http://Mydomain.com"; that site generates a "key" value every time we visit. once you type mydomain.com in browser then it will change it like "mydomain.com/?mykey=akey-31243-and-4232" i need to store this mykey value. how can we do this with file_get_contents or some other technology like cURL... Any help? Quote Link to comment Share on other sites More sharing options...
KrisNz Posted February 5, 2007 Share Posted February 5, 2007 I had some success with the following... $ch = curl_init(); $url ="http://www.php.net/curl_setopt"; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true); $result = curl_exec($ch); $url_actual = curl_getinfo($ch,CURLINFO_EFFECTIVE_URL); curl_close($ch); echo ($url_actual); //for me it echo's http://au.php.net/curl_setopt but it will depend your location I'm not 100% sure this will apply to your situation but give it a go. Quote Link to comment 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.