Jump to content

HTTP REFERER Problem


mtlhd

Recommended Posts

I cant seem to find what is wrong with this script....

 

$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';

if ($referer == "http://www.example.com/"){

$subject = $name . ", referred from example.com";

} Else {

$subject = $name;

}

 

anyone see why that isnt coming thru, it should be the header of an email, but it never comes thru.  My hit counter watching for hits from that referral works fine.

 

craziness.

 

thanks in advance PHP community.

Link to comment
https://forums.phpfreaks.com/topic/137744-http-referer-problem/
Share on other sites

I cant seem to find what is wrong with this script....

 

$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';

if ($referer == "http://www.example.com/"){

$subject = $name . ", referred from example.com";

} Else {

$subject = $name;

}

 

anyone see why that isnt coming thru, it should be the header of an email, but it never comes thru.  My hit counter watching for hits from that referral works fine.

 

craziness.

 

thanks in advance PHP community.

hello!

 

the page must be exactly as it was referenced.

try this to know what you got:

 

<?php

$lastPage = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;

// var_dump just to see what you got
// null means the page was not referenced
var_dump($lastPage);

echo '<br />';

if($lastPage == 'http://domain/')
	echo 'ok';
else
	echo 'oh shit';

?>

 

Link to comment
https://forums.phpfreaks.com/topic/137744-http-referer-problem/#findComment-720070
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.