Jump to content

Form entry coming through blank?


dgh1981

Recommended Posts

Hi there simple form only two entries but entry is coming through blank for some reason in email?

here is form:

<div id="contact-area" style="width: 399px">

 

<form method="post" action="form2/contactengine.php">

<div class="style31">

<span class="style30">     

 

</span>

 

<br class="style30" />

 

 <br class="style30" />

<span class="style30"> 

</span>

<table style="width: 100%">

<tr>

<td class="style30">

<label for="Name">Full Name:</label></td>

<td>

<input type="text" name="Name" id="Name" size="150" style="width: 280px; color: #000000;" /></td>

</tr>

<tr>

<td class="style30">

 

<label for="Email">Email:</label></td>

<td>

<input type="text" name="Email" id="Email" style="width: 280px; color: #000000;" class="style30" /></td>

</tr>

</table>

 

<input type="submit" name="submit" value="Submit" style="width: 98px" /><span class="style30">

</span>

</div>

</form>

 

<div style="clear: both;"></div>

 

<p> </p>

 

</div>

 

and here is the php engine:

<?php

 

$EmailFrom = "Female Escort Entry";

$EmailTo = "[email protected]";

$Subject = "Female Escort Password";

$firstnames = Trim(stripslashes($_POST['Name']));

$email = Trim(stripslashes($_POST['Email']));

 

 

 

// validation

$validationOK=true;

if (!$validationOK) {

  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";

  exit;

}

 

// prepare email body text

$Body = "";

$Body .= "Name: ";

$Body .= $Name;

$Body .= "\n";

$Body .= "Email: ";

$Body .= $Email;

$Body .= "\n";

 

 

 

 

 

 

// send email

$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

 

// redirect to success page

if ($success){

  print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">";

}

else{

  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";

}

?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/181721-form-entry-coming-through-blank/
Share on other sites

You are using the incorrect variable names, you store the name in a variable called $firstname, but in the e-mail you use $Name. Variable names are also case sensitive so $email is different to $Email.

 

$firstnames = Trim(stripslashes($_POST['Name']));
$email = Trim(stripslashes($_POST['Email']));
...
$Body .= $Name;;
...
$Body .= $Email;

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.