Looking for a programer

Status
Not open for further replies.

hugo Pata

Registered Member
Joined
Jul 8, 2013
Messages
65
Reaction score
3
I need someone to make me a site that will show a special message only to people that come from x site.
 
I need someone to make me a site that will show a special message only to people that come from x site.

Hey,
I am a professional web developer from Germany and I can create your website with PHP, please add me at skype to discuss your project. My id is max-shawn
 
You can look for programmers on site like Upwork or Freelancer
 
Just add this code where you want the message shown:
PHP:
<?php
$ref_site = "referringsite.com";
if(isset($_SERVER['HTTP_REFERER'])){if(strstr($_SERVER['HTTP_REFERER'],$ref_site)){echo "You Visited Us From ".$ref_site;}}
?>
 
Just add this code where you want the message shown:
PHP:
<?php
$ref_site = "referringsite.com";
if(isset($_SERVER['HTTP_REFERER'])){if(strstr($_SERVER['HTTP_REFERER'],$ref_site)){echo "You Visited Us From ".$ref_site;}}
?>
What if the refering site is facebook or some other social media it will still work. Can i add multiple referer cuz fb may send the traffic as l.facebook.com or m.facebook.com. Thanks
 
What if the refering site is facebook or some other social media it will still work. Can i add multiple referer cuz fb may send the traffic as l.facebook.com or m.facebook.com. Thanks

You can add multiple URL's:
PHP:
<?php
$ref_sites = array("referringsite.com", "referringsite2.com", "referringsite3.com");
$allowed=0;
if(isset($_SERVER['HTTP_REFERER'])){
	foreach($ref_sites as $ref_site){
		if(strstr($_SERVER['HTTP_REFERER'],$ref_site)){$allowed=1;break;}
		}
	}
if($allowed==1){
	echo "You Visited Us From ".$ref_site;
	}
?>

As long as the URL contains the word then it is ok, e.g.
$ref_sites = array("somesite.com");

^^ That would support: http://somesite.com, http://www.somesite.com, http://anything.somesite.com/anything.php
 
Status
Not open for further replies.
This thread has been auto closed due to the forum's thread age policy. Read more.
Back
Top