I am a bit of a PHP Noob, so this might be basic. I have a contact form in PHP/Bootstrap using this example blog
https://jonbake.com/blog/bootstrap-3-contact-form-with-captcha/
I am trying to amend the sendmail.php file to include the URL which the contact form resides on.
I.e. We have 3 or so different contact forms and would like to determine where the user sent the contact email from.
I could just copy the file three times and change the subject for an example which would be fine. But ideally I would like just one sendmail.php file and to pass in the URL the form/email is being sent from.
Question
How do I get the URL and pass that into this PHP file and amend to the email?
EDIT
AJAX is used to send the POST to sendmail.php if this makes a difference on how the link can be passed.
//send the feedback e-mail
$.ajax({
type: "POST",
url: "../assets/library/sendmail.php",
data: $("#feedbackForm").serialize(),
success: function(data)
{
contactForm.addAjaxMessage(data.message, false);
//get new Captcha on success
$('#captcha').attr('src', '../assets/library/vender/securimage/securimage_show.php?' + Math.random());
},
error: function(response)
{
contactForm.addAjaxMessage(response.responseJSON.message, true);
}
});
return false;
});
Thanks