Jump to content

WilliamS9659

New Members
  • Posts

    4
  • Joined

  • Last visited

WilliamS9659's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am not really sure. I thought once I hit Submit it would trigger php and once everything is satisfied in the PHP code it would email me it. I did attach website to first post. Its not very big. Thank you so much for all your help
  2. Where would I place the action you mentioned in my script? <form method="POST" action="Contact_Me.php" name="sentMessage" id="contactForm" novalidate>
  3. I hope this is what you meant by relevant code. Thanks Everyone For all your help and assistance. Contact Form Code Below <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> <p>Want to get in touch with me? Fill out the form below to send me a message and I will try to get back to you within 24 hours!</p> <!-- Contact Form - Enter your email address on line 19 of the mail/contact_me.php file to make this form work. --> <!-- WARNING: Some web hosts do not allow emails to be sent through forms to common mail hosts like Gmail or Yahoo. It's recommended that you use a private domain email address! --> <!-- NOTE: To use the contact form, your site must be on a live web host with PHP! The form will not work locally! --> <form name="sentMessage" id="contactForm" novalidate> <div class="row control-group"> <div class="form-group col-xs-12 floating-label-form-group controls"> <label>Name</label> <input type="text" class="form-control" placeholder="Name" id="name" required data-validation-required-message="Please enter your name."> <p class="help-block text-danger"></p> </div> </div> <div class="row control-group"> <div class="form-group col-xs-12 floating-label-form-group controls"> <label>Email Address</label> <input type="email" class="form-control" placeholder="Email Address" id="email" required data-validation-required-message="Please enter your email address."> <p class="help-block text-danger"></p> </div> </div> <div class="row control-group"> <div class="form-group col-xs-12 floating-label-form-group controls"> <label>Phone Number</label> <input type="tel" class="form-control" placeholder="Phone Number" id="phone" required data-validation-required-message="Please enter your phone number."> <p class="help-block text-danger"></p> </div> </div> <div class="row control-group"> <div class="form-group col-xs-12 floating-label-form-group controls"> <label>Message</label> <textarea rows="5" class="form-control" placeholder="Message" id="message" required data-validation-required-message="Please enter a message."></textarea> <p class="help-block text-danger"></p> </div> </div> <br> <div id="success"></div> <div class="row"> <div class="form-group col-xs-12"> <a href="index.html"> <button type="submit" class="btn btn-default">Send</button> </a> </div> </div> </form> </div> </div> </div> Contact_Me.PHP for form Below (I removed Email Address) <?php // Check for empty fields if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['phone']) || empty($_POST['message']) || !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) { echo "No arguments Provided!"; return false; } $name = $_POST['name']; $email_address = $_POST['email']; $phone = $_POST['phone']; $message = $_POST['message']; // Create the email and send the message $to = 'MyEmailGoesHere.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to. $email_subject = "Website Contact Form: $name"; $email_body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email_address\n\nPhone: $phone\n\nMessage:\n$message"; $headers = "From: noreply@yourdomain.com\n"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com. $headers .= "Reply-To: $email_address"; mail($to,$email_subject,$email_body,$headers); return true; ?>
  4. I am really new to creating websites I am trying to create one for a friend. I attached zip file of site. I used generic photos I will replace soon. My issue is in the Contact Form when I hit submit button it does not work. I wanted it to redirect to contact_me.php which is located in mail file. The structure I am using is for a free form I downloaded. Thanks everyone for all your help in advance. I just cannot make the connection occur between the the button and php to work properly ugh!! I also would really appreciate any directions and comments. The blog section is not done yet. Sweetshoppe.zip
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.