I've spent some time trying to figure out a way to allow users to contact me via my landing page. Being fairly new to programming and having used snippets of code from multiple sources I am at my wits end and would love some help. My troubleshooting has centered around:
I. Did I setup my local server correctly?
And if so, am I missing a package on WAMP and/or mail server? I referenced php mail setup in xampp this post.
II. Is my HTML code faulty?
<div class="container-contact100-form-btn">
<button type="submit" value="Send" class="contact100-form-btn">
Send Message
</button>
</div>
III. Am I needing to edit/adjust my JS file to accommodate the additional functionality?
function showValidate(input) {
var thisAlert = $(input).parent();
$(thisAlert).addClass('alert-validate');
$(thisAlert).append('<span class="btn-hide-validate"></span>')
$('.btn-hide-validate').each(function(){
$(this).on('click',function(){
hideValidate(this);
});
});
}
function hideValidate(input) {
var thisAlert = $(input).parent();
$(thisAlert).removeClass('alert-validate');
$(thisAlert).find('.btn-hide-validate').remove();
}
IV. Is something missing from the PHP code?
<?php
if( isset($_POST['Send Message']))
$name = $_POST['name'];
$email = $_POST['email'];
$bar = $_POST['bar'];
$message = $_POST['message'];
$email_from = $email;
$email_subject = "New Contact Us Email";
$email_body = "You have received a new message from the user $name.\n".
"Here's the message: \n $message".
$to = 'I had my email here';
mail($to, $email_subject, $email_body)
?>
I really would appreciate any help and/or links that might lead me down the right path. Thank you!