Ruth.Adele
New Member
Hi, i'm a newbie at PHP, i learned this particular form at a short course i attended - so i'm not exactly sure whats going on...
It works - to a point.
The email comes through to the specified address, but all the information that the client inputs on the website is missing.
Can anyone help me!?
Thanks
This is my HTML:
<div id="membershipform">
<form id="c-form" name="form1" method="post" action="emailform.php">
<p>
<label>Name</label><br />
<input type="text" name="name" id="name" /><br />
<label>Email</label><br />
<input type="text" name="sendersemail" id="sendersemail" /><br />
<label>Phone Number</label><br />
<input type="text" name="phone" id="phone" /><br />
<label>Postcode</label><br />
<input type="text" name="postcode" id="postcode" /><br />
<input type="submit" name="Submit" id="button" value="Submit" /></p>
</form>
</div>
And this is my PHP form:
<body>
<?php
if($sentemail == "2"){
include("sorry.html");
}else{
$num = $sentmessage + 1;
$email = "
Name:\t$name\n
Email:\t$sendersemail\n
Phone Number:\t$phone\n
Postcode:\t$postcode\"";
$to = "[email protected]";
$subject = "New Membership";
$mailheaders = "From: $sendersemail\n";
$mailheaders .= "Reply-To: $sendersemail\n\n";
mail ($to, $subject, $email, $mailheaders);
include("thanks.html");
$to = "$sendersemail";
$subject = "Your membership has been confirmed";
mail($to, $subject, $email, $mailheaders);
}
?>
</body>
Thanks again! Please help!
It works - to a point.
The email comes through to the specified address, but all the information that the client inputs on the website is missing.
Can anyone help me!?
Thanks
This is my HTML:
<div id="membershipform">
<form id="c-form" name="form1" method="post" action="emailform.php">
<p>
<label>Name</label><br />
<input type="text" name="name" id="name" /><br />
<label>Email</label><br />
<input type="text" name="sendersemail" id="sendersemail" /><br />
<label>Phone Number</label><br />
<input type="text" name="phone" id="phone" /><br />
<label>Postcode</label><br />
<input type="text" name="postcode" id="postcode" /><br />
<input type="submit" name="Submit" id="button" value="Submit" /></p>
</form>
</div>
And this is my PHP form:
<body>
<?php
if($sentemail == "2"){
include("sorry.html");
}else{
$num = $sentmessage + 1;
$email = "
Name:\t$name\n
Email:\t$sendersemail\n
Phone Number:\t$phone\n
Postcode:\t$postcode\"";
$to = "[email protected]";
$subject = "New Membership";
$mailheaders = "From: $sendersemail\n";
$mailheaders .= "Reply-To: $sendersemail\n\n";
mail ($to, $subject, $email, $mailheaders);
include("thanks.html");
$to = "$sendersemail";
$subject = "Your membership has been confirmed";
mail($to, $subject, $email, $mailheaders);
}
?>
</body>
Thanks again! Please help!