Hello PHP Expert, I want to fetch data from remote server , using curl or file_get_contents(). What I want as I donot want to show my identity as a referer. Please suggest how can i do this or what to use curl/file_get_contents? Thanks in advance for your valuable suggestion.
just an example, search google you will tons of tutorials $url = "http://www.google.com"; $ch = curl_init($url); $userAgent = 'Googlebot/2.1 (http://www.googlebot.com/bot.html)'; curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_REFERER, 'http://www.xxxxxxxxxxxxxxxxxxxxxxxxx.com/'); $myData = curl_exec($ch); curl_close($ch); echo $myData; PHP: