One of my clients wants applications sent to different email addresses based on where the user has came from.
I know i can use the referrer php code but when the user clicks the apply button the referrer changes to the home page url. if that make sense?
So what i have done is add this to the homepage:
<?php
$referrer = $_SERVER['HTTP_REFERER'];
?>
I need to pass the $referrer var to the contact page, and then it also needs to go into the sendmail.php script.
So i would use something like
<?php
if $referrer == "yahoo adwords link, whatever that may be?" {
$address = "firstaddress";
} elseif $referrer == "google adwords link, whatever that may be?" {
$address = "secondaddress";
}
?>
Basically my client wants to know where leads are coming from, if they come from yahoo he wants it to go to his yahoo address. If it comes from google adwords he wants it to go to his gmail address.
Question
game_over
One of my clients wants applications sent to different email addresses based on where the user has came from.
I know i can use the referrer php code but when the user clicks the apply button the referrer changes to the home page url. if that make sense?
So what i have done is add this to the homepage:
<?php
$referrer = $_SERVER['HTTP_REFERER'];
?>
I need to pass the $referrer var to the contact page, and then it also needs to go into the sendmail.php script.
So i would use something like
<?php
if $referrer == "yahoo adwords link, whatever that may be?" {
$address = "firstaddress";
} elseif $referrer == "google adwords link, whatever that may be?" {
$address = "secondaddress";
}
?>
Basically my client wants to know where leads are coming from, if they come from yahoo he wants it to go to his yahoo address. If it comes from google adwords he wants it to go to his gmail address.
Link to comment
Share on other sites
7 answers to this question
Recommended Posts