Results 1 to 2 of 2

Thread: Help with email contact form please.

  1. #1
    Join Date
    Apr 2010
    Posts
    1

    Help with email contact form please.

    Hello. I have started to create a website for my business using the shapeshifter template from themeforest.

    I have created nearly the entirety of my site with no trouble but I can't get the dang email contact form to work.

    Here is the HTML:

    HTML Code:
    	<form action="../library/scripts/send.php" method="post">
    	<p>Your Name (required)<br />
    	    <span><input type="text" id="name" name="name" value="" size="40" /></span> </p>
    	<p>Your Email (required)<br />
    	    <span><input type="text" id="email" name="email" value=""size="40" /></span> </p>
    	<p>Subject<br />
    	    <span><input type="text" id="subject" name="subject" value="" size="40" /></span> </p>
    	<p>Your Message<br />
    	  <textarea name="message" cols="40" id="message"></textarea>
    	</p>
    	    
    	<p><input class="button" type="submit" value="Send" /></p>
    	</form>
    	
    	</div>
    and here is the PHP:

    PHP Code:
    <?php 

    //****************************************
    $to 'test@bigriverfilms.co.uk'//edit here
    //****************************************

    $name $_POST['name'];
    $email $_POST['email'];
    $subject $_POST['subject'];
    $message $_POST['message'];

    mail($to'Website Form Request''   name:   '.$name.'   email:   '.$email.'   subject:   '.$subject.'    enquiry:   '.$message);
    header("Location: ".@$_SERVER['HTTP_REFERER'].'#sent');
    ?>
    When testing the form I do not recieve an email in my inbox. Probably really obvious but can anyone tell me where I am going wrong?

    Thanks!
    Last edited by <CrGeary.com/>; 26 Apr 2010 at 02:21 AM. Reason: Switch code tags to HTML/PHP tags

  2. #2
    Join Date
    May 2009
    Posts
    130
    Well, are you testing locally? Because if you are, I think that you need a mail server to actually be able to send the mail.

    Also, you might try:
    PHP Code:
    mail($email$message$subject); 
    instead of:
    PHP Code:
    mail($to'Website Form Request''   name:   '.$name.'   email:   '.$email.'   subject:   '.$subject.'    enquiry:   '.$message); 

Similar Threads

  1. Creating Required Fields for a Contact Form
    By Bonanza84 in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 02 Apr 2009, 11:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •