Jump to content

It's not fair! I'm not getting input, only labels.


Recommended Posts

I only get the form in the email but I do not have the results.

 

 

Here is what they see...

 

<form action="index-6contact.php" method="post" id="form1"><div style="margin:0 0 0 20px ">
<table width="200">
<tr>
	<td align="right">Name:</td>
	<td align="left"><input name="name" type="text" size="34" maxlength="100"></td>
</tr>
<tr>
	<td align="right">Email:</td>
	<td align="left"><input name="email" type="text" size="34" maxlength="100"></td>
</tr>
<tr>
	<td align="right" valign="top">Message:</td>
	<td align="left"><textarea name="message" wrap="hard" cols="26" rows="20"></textarea></td>
</tr>
<tr>
	<td align="right"><input type="reset" name="clear" id="clear" value="Reset Form"></td>
	<td align="left"><input type="submit" name="submit" id="submit" value="Send Email"></td>
</tr>
</table></div>
</form>

 

Here is the PHP...

 

<?php

/* Subject and Email Variables */

$emailSubject = 'Customer Inquiry';
$webMaster = '[email protected]';

/* Gathering Data Variables */

$nameField = $_POST['name'];
$emailField = $_POST['email'];
$messageField = $_POST['message'];

$body = <<<EOD
<br><hr><br>
Hello, my name is: $name <br>
Please contact me at: $email <br>
My issue is: $message <br>
<br><hr><br>
EOD;

$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);

It looks like the name, email, and body fields are mistypes. Try:

<?php

/* Subject and Email Variables */

   $emailSubject = 'Customer Inquiry';
   $webMaster = '[email protected]';
   
/* Gathering Data Variables */

   $nameField = $_POST['name'];
   $emailField = $_POST['email'];
   $messageField = $_POST['message'];

   $body = <<<EOD
<br><hr><br>
Hello, my name is: $nameField <br>
Please contact me at: $emailField <br>
My issue is: $messageField <br>
<br><hr><br>
EOD;

   $headers = "From: $email\r\n";
   $headers .= "Content-type: text/html\r\n";
   $success = mail($webMaster, $emailSubject, $body, $headers);
?>

Archived

This topic is now archived and is closed to further replies.

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