etrader Posted February 18, 2011 Share Posted February 18, 2011 When making a fake identity in cURL, we use curl_setopt($ch, CURLOPT_USERAGENT, 'Googlebot/2.1 (http://www.googlebot.com/bot.html)'); but which is better for the referrer: curl_setopt($ch, CURLOPT_AUTOREFERER, true); or curl_setopt ($ch, CURLOPT_REFERER, "http://www.google.com/bot.html"); Quote Link to comment https://forums.phpfreaks.com/topic/228134-fake-referrer-in-curl/ Share on other sites More sharing options...
.josh Posted February 19, 2011 Share Posted February 19, 2011 well the first one makes it automatic, so it will be whatever it really is. The 2nd one you get to explicitly state what it is. Seeing as how you are trying to fake stuff, you should go for the 2nd (CURLOPT_REFERER) Quote Link to comment https://forums.phpfreaks.com/topic/228134-fake-referrer-in-curl/#findComment-1176588 Share on other sites More sharing options...
etrader Posted February 19, 2011 Author Share Posted February 19, 2011 Thanks for your informative reply. One more question. Does the order has an influence on cURL processing? I mean changing the order of lines in curl_setopt($ch, CURLOPT_USERAGENT, 'Googlebot/2.1 (http://www.googlebot.com/bot.html)'); curl_setopt($ch, CURLOPT_URL,"http://www.site.com"); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_REFERER, 'http://www.google.com/bot.html'); curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_TIMEOUT, 10); Quote Link to comment https://forums.phpfreaks.com/topic/228134-fake-referrer-in-curl/#findComment-1176635 Share on other sites More sharing options...
.josh Posted February 19, 2011 Share Posted February 19, 2011 There is one note in the manual that mentions rearranging order of calls to curl_setopt() for posting data, but other than that, afaik it doesn't matter which order you put that stuff in. Quote Link to comment https://forums.phpfreaks.com/topic/228134-fake-referrer-in-curl/#findComment-1176715 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.