I use the same form on multiple pages within one website. Each page has a different category, so when someone send a question I want to know on which page the form was used. How to include the URL of the page on which the form was used? I want to modify just .php file, not all files on all pages.
Here is the code
<?php
$addressto = "info@x.co.uk";
$subject = "Message from the website x.co.uk";
$content = "First Name: ".$_POST['first-name']."\n"
."Last Name: ".$_POST['last-name']."\n"
."Company: ".$_POST['company']."\n"
."Email: ".$_POST['email']."\n"
."Tel.: ".$_POST['phone']."\n"
."Event Date: ".$_POST['date']."\n"
."Location: ".$_POST['location']."\n"
."No of guests: ".$_POST['guests']."\n"
."Message: ".$_POST['message']."\n"
."Referer: ".$_POST['findus']."\n";
$email = $_POST['email'];
if (mail($addressto, $subject, $content, 'From: <' . $email . '>')) {
header("Location: message-sent.html");
}
?>
Thank you