dgh1981 Posted November 16, 2009 Share Posted November 16, 2009 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 More sharing options...
cags Posted November 16, 2009 Share Posted November 16, 2009 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; Link to comment https://forums.phpfreaks.com/topic/181721-form-entry-coming-through-blank/#findComment-958427 Share on other sites More sharing options...
dgh1981 Posted November 16, 2009 Author Share Posted November 16, 2009 lol I just noticed that! Thanks anyway I'm such a dufus!!!!!! Link to comment https://forums.phpfreaks.com/topic/181721-form-entry-coming-through-blank/#findComment-958428 Share on other sites More sharing options...
cags Posted November 16, 2009 Share Posted November 16, 2009 Everybody does it now and then. Remember to mark the topic as 'Solved' (button is in the bottom left hand side of the thread). Link to comment https://forums.phpfreaks.com/topic/181721-form-entry-coming-through-blank/#findComment-958433 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.