Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.