Jump to content

Recommended Posts

Hello

 

I have a form on my website that runs a php script to email the form to my address. I have managed to get the form to email itself to me but the details do not appear in the email.

 

Here is the script:

 

<?php

 

$emailsubject = 'Contact Form';

$webMaster = '[email protected]';

 

$fullname = $_POST['fullname'];

$email = $_POST['email'];

$telnumber = $_POST['telnumber'];

$address1 = $_POST['address1'];

$address2 = $_POST['address2'];

$town = $_POST['town'];

$postcode = $_POST['postcode'];

 

$machinetype = $_POST['machinetype'];

$os = $_POST['os'];

$querytype = $_POST['querytype'];

$other = $_POST['other'];

$details = $_POST['details'];

 

$body = <<<EOD

Full Name: $fullname

Email Address: $email

Tel Number : $telnumber

Address Line 1: $address1

Address Line 2: $address2

Town: $town

Postcode: $postcode

Machine Type: $machinetype

Operating System: $os

Query Type: $querytype

Other: $other

Details: $details

EOD;

 

$headers = "From: $email\r\n";

$headers .= "Content=type: text/html\r\n";

 

mail($webMaster, $emailsubject, $body, $headers);

 

header('Location: thanks.html');

?>

 

 

Obviously i have made sure al the variable names are correct. This is all i get in the email:

 

-----Original Message-----

From:

Sent: 23 July 2008 19:27

To: [email protected]

Subject: Contact Form

 

 

Full Name:

Email Address:

Tel Number :

Address Line 1:

Address Line 2:

Town:

Postcode:

Machine Type:

Operating System:

Query Type:

Other:

Details:

 

 

The php script is obviously being processed when the users clicks submit but the details the user types in are not being sent with the form. Any help would be apreciated.

 

The form actual is here:

 

http://www.complain2.co.uk/pcsite/quote.html

Link to comment
https://forums.phpfreaks.com/topic/116269-help-with-php-form-script/
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.