I have a website with multiple links 'book now' to a contact form. I want my php contact form to record which 'book now' link was clicked through to the booking form. So I know without the customer telling me, which part of the website they are coming from.
On the sales page:
Then we use POST on the contact form and here is an example of the code (in part):
<a href="<?php echo($domain); ?>/contact.php"><img src="book.gif" alt="Book Now" border="0" /></a>
$SendTo = "XXX";
$Subject = "".$_POST['name']. ": booking";
$FromString = "From: ".$_POST['email']."\r\n";
$Indhold .= "I found the website by: ".$_POST['source']."\n";
$Indhold .= "Looking at this tour: ".$_POST['tourname']."\n";
I found the following thread which is very close to what I am trying to achieve.
Here is the thing, I have a few links to the contact form on each URL (the same page, different tour codes linking to same contact form). So I can't use
as I will still not know exactly which tour they were looking at.
$ref = getenv("HTTP_REFERER");
So I guess each link needs to have it's own variable, but I can't see how to store this on my contact page.
Any help appreciated.