Reputation: 19
I'm using this code for to fake the referrer of a user when he clicks on my link, to make it look like he's coming from Facebook:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://bit.ly/randomurl');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, 'https://www.facebook.com/')
$html = curl_exec($ch);
?>
But it doesn't seem to be working, as the referrer I see is the url of the code above. How can I fix it? And I really could appreciate some help with the coding as I'm not a coder.
Upvotes: 1
Views: 1277
Reputation: 943578
I'm using Live HTTP Headers from Mozilla
You are examining the headers sent by Firefox, but the referer header you are setting manually is being sent by PHP/cURL. That is a different HTTP client and a different set of HTTP requests.
http://bit.ly/randomurl
(and send the referer header you manually specify to it).http://bit.ly/randomurl
will respond to your PHP program.Upvotes: 2