How to hide referer using PHP from backend?

Discussion in 'PHP' started by webmaster365, Apr 7, 2011.

  1. #1
    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.
     
    webmaster365, Apr 7, 2011 IP
  2. artus.systems

    artus.systems Well-Known Member

    Messages:
    87
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    103
    #2
    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:
     
    artus.systems, Apr 7, 2011 IP
  3. mike323

    mike323 Well-Known Member

    Messages:
    1,594
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    160
    #3
    What are you doing?

    http://www.tubechop.com/watch/150288

     
    mike323, Apr 7, 2011 IP