Jump to content

Contact form help


tecmeister

Recommended Posts

Im having some trouble with the contact form that i have created.

This is the code that i have used on the first page:

<form method="POST" action="sendeail.php">
   Contact Name:<input type="text" name="name" size="30"><br>
   <br>
   Contact Company:<input type="text" name="company" size="30">
   <br>
<br>
   Contact Email:<input type="text" name="email" size="30"><br>
   <br>
   Message<br>
   <textarea rows="9" name="message" cols="50"></textarea>
   <br>
   <br>
   <input type="submit" value="Send Email" name="Submit">
</form>

 

Second page

 

?>
        
        <!-- Reminder: Add the link for the 'next page' (at the bottom) -->
<!-- Reminder: Change 'YourEmail' to Your real email -->

<?php
if(isset($_POST['submit'])) {

$to = "support@nurevolution.co.uk";
$subject = "Form Tutorial";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$company_field = $_POST['company'];
$message = $_POST['message'];

$body = "From: $name_field\n E-Mail: $company_field\n Company; $email_field\n Message:\n $message";

echo "Data has been submitted to $to!";
mail($to, $subject, $body);
}
?>

 

Thanks for the help

 

tecmeister

Link to comment
Share on other sites

I use a class for sending my emails php mailer see link below

 

http://phpmailer.codeworxtech.com/

 

It's a really good class and allow attachments and everything.

 

As long as your getting your "Data has been submitted to $to!" message the it's down to mail() with the issue.

 

Regards

Liam

 

 

BTW I know that feeling... I have a 6 month old girl lol

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.