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? Link to comment https://forums.phpfreaks.com/topic/37086-advanced-file_get_contents-or-something-to-store-a-get-method-data/ 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. Link to comment https://forums.phpfreaks.com/topic/37086-advanced-file_get_contents-or-something-to-store-a-get-method-data/#findComment-177124 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.