Recently, I’ve been trying to get a contact form setup on the website (I found and have been using code I found online since I’m not great with php :()
Anyway, It’s a simple enough form that basically has a dropdown to choose subject, inputs to wite email, name and the message itself. I’ve tested it and it doesn’t send to my emails (I’ve tried more than one).
Anyway, here is the code, maybe it’s a rookie mistake I am just missing?
Element you are setting the mail function to a variable but do not do anything with it. Try
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. Please give us some time to review the message and you will be contacted shortly.');
window.location = 'index.html';
</script>
<?php
[B] echo $mail_status;[/B]
}
else { ?>
Ah thanks for the heads up, that was one of my worries, as well as spam. Do you happen to know of any resources online that provide a contact form (preferably free) that stops spam and mail injection? I’ll continue to look for one, however.
Element
P.S I believe I could just use recaptcha or something similar to prevent spam, is this correct?
Thanks for the response, but I’m not so sure how I would go about coding that, as I am fairly new to PHP, any tips? In addition, would reCAPTCHA work instead of a logic question?
Ah thanks a ton, so provided I use a logic question, it should reduce / eliminate the possibility of mail injection seeing as most of them are bots? Correct?