Jump to content

jimi71

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jimi71's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. akitchin, raza.shahzad, corbin, you guys rock....I see it now! And I got it! I am new to php but I am starting to realize that as long as you follow the bouncing ball it will all make sense in the end. :) Thank you!
  2. Hey guys! I was wondering ???: Can I add a checkbox, that if checked, sends the email to an adress I specify? As I have it, the person writes in the text area and sends that info to an email address that they input. I would like to add a checkbox right before the SEND button that says, "if you want to send me a copy, please check this box" Any Ideas? Thanks! ----- Heres the code I am using: <?php // your own email address $your_email = ($_POST['txtEmail']); // email subject line $subject = "Message via your contact form"; // This is displayed if all the fields are not filled in $empty_fields_message = "<p>Please go back and complete all the fields in the form.</p>"; // This is displayed when the email has been sent $thankyou_message = "<p>Thankyou. Your message has been sent.</p>"; // do not need to edit these lines $name = stripslashes($_POST['txtName']); $email = stripslashes($_POST['txtEmail']); $message = stripslashes($_POST['txtMessage']); if (!isset($_POST['txtName'])) { ?> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">     <p><label for="txtName">Name:</label><br />     <input type="text" title="Enter your name" name="txtName" /></p>     <p><label for="txtEmail">Email:</label><br />     <input type="text" title="Enter your email address" name="txtEmail" /></p>     <p><label for="txtMessage">Your message:</label><br />     <textarea title="Enter your message" name="txtMessage"></textarea></p>     <p><label title="Send your message">     <input type="submit" value="Send" /></label></p> </form> <?php } elseif (empty($name) || empty($email) || empty($message)) {     echo $empty_fields_message; } else {     // Stop the form being used from an external URL     // Get the referring URL     $referer = $_SERVER['HTTP_REFERER'];     // Get the URL of this page     $this_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"];     // If the referring URL and the URL of this page don't match then     // display a message and don't send the email.     if ($referer != $this_url) {         echo "You do not have permission to use this script from another URL.";         exit;     }     // The URLs matched so send the email     mail($your_email, $subject, $message, "From: $name <$email>");     // Display the thankyou message     echo $thankyou_message;     } ?>
×
×
  • 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.