Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $(".show").click(function (){
- $(".web, .about, .tel, .email").hide();
- $("." + $(this).attr("show-class")).fadeIn("fast");
- });
- });
- <li><a href="#" class="show" show-class="email">E-mail</a></li>
- <div class="email">
- <form method="post" action="">
- <input name="name" placeholder="Name (required)">
- <input name="email" type="email" placeholder="E-mail (required)">
- <textarea name="message" placeholder="Message"></textarea>
- <input name="submit" type="submit" value="Submit">
- </form>
- <?php
- $name = $_POST['name'];
- $email = $_POST['email'];
- $message = $_POST['message'];
- $to = 'example@example.com';
- $subject = 'Hi! From Example.com';
- $body = "From: $namen E-Mail: $emailn Message:n $message";
- if ($_POST['submit']) {
- if ($name != '' && $email != '') {
- if (mail ($to, $subject, $body)) {
- echo '<p>Your message has been sent.</p>';
- } else {
- echo '<p>Something went wrong, go back and try again.</p>';
- }
- } else {
- echo '<p>Please fill in required information.</p>';
- }
- }
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement