Jump to content

stcolumb

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

stcolumb's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks - this also works a treat!! now when I receive an email I get; Subject: xxxx From: xxxxxx Message: xxxxxx -- However I don't get a 'Reply to:' field, is this missing? I just noticed that on my actual form, if I don't enter an email address, the form validates and produces the 'I think you forget to enter your e-mail id.' But if I enter an incorrect email (like .bom or .cpm etc) the email form just 'shakes' a bit but produces no error. Could this be linked? thanks
  2. thanks downah, but where do I put this code exactly?
  3. That worked!! Really, thank you very much I was having real trouble with that and couldn't find an answer anywhere, first post here, and wahey! I am such a noob at php. I know I am pushing it but can I ask one more thing, now that my email sends fine with a subject title, name of sender, and message content.. How do I get all of this information in my email when I open it, eg: I have all the necessary info, just would like it all in the one place - although not THAT important! Thanks again!!!
  4. thanks - i'll give this a go now and let you know!
  5. Hi, I am very new to php, and have a contact form on my website (which works!). However, when I receive the email, there is no email subject in the email header. I can see them email content fine, and the senders name, but no email Title. Could somebody possible take a look at the code and see if they spot anything? Thanks in advance, This is my index.html form code <form id="ajax-contact-form" action="javascript:alert('success!');"> <fieldset class="info_fieldset"> <div id="note"></div> <div id="fields"> <label>Name :</label><input class="textbox" type="text" name="name" value="" /><br /> <label>E-Mail :</label><input class="textbox" type="text" name="email" value="" /><br /> <label>Message :</label> <textarea class="textbox2" name="message" rows="5" cols="25"></textarea> <label> </label><input class="button" type="image" src="images/sendNew.png" id="submit" value="Send Message" /> </div> </fieldset> </form> This is my contact.php code... <?php include 'config.php'; error_reporting (E_ALL ^ E_NOTICE); $post = (!empty($_POST)) ? true : false; if($post) { include 'functions.php'; $name = stripslashes($_POST['name']); $email = trim($_POST['email']); $message = stripslashes($_POST['message']); $error = ''; // Check name if(!$name) { $error .= 'I think you forget to enter your name.<br />'; } // Check email if(!$email) { $error .= 'I think you forget to enter your e-mail id.<br />'; } if($email && !ValidateEmail($email)) { $error .= 'Invalid E-mail id !!!<br />'; } if(!$error) { $mail = mail(WEBMASTER_EMAIL, $subject, $message, "From: ".$name." <".$email.">\r\n" ."Reply-To: ".$email."\r\n" ."X-Mailer: PHP/" . phpversion()); if($mail) { echo 'OK'; } } else { echo '<div class="notification_error">'.$error.'</div>'; } } ?> Finally this is my config.php code.. <?php // To define("WEBMASTER_EMAIL", 'xxxxxx@xxxxxx.com'); ?> note - I have a contact.php, config.php, functions.php and feedback.php on my webserver, I also have a few javascript files which I think are related to this form - sorry to sound really confusing but I downloaded this form with a template. Like I said, the contact form works fine, just no subject when I get the email. Is it something to do with $headers?? thanks again.
×
×
  • 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.