title: Include URL in PHP form
body: <p>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.</p>
  
  <p>Here is the code</p>
  
  <pre><code>    &lt;?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: &lt;' . $email . '&gt;')) {
              header("Location: message-sent.html");
          }
  
      ?&gt;
  </code></pre>
  
  <p>Thank you</p>