<form method="post">
<input type="text" name="ea" id="ea" value="<enter your email>"size="20" style="width:180px; margin-left:0px" autocomplete="off">
<input type="submit" value="Join"/>
</form>
<?php
if(isset($_POST['hidSubmit']))
{
$to = "xxx@gmail.com";
$Subject = "Request to Join Mailing List";
$message = $ea;
mail($to,$Subject,$message);
if(mail){
echo "<BR />Thanks, message sent";
}
else{
echo "<BR /> An Error occurred";
}
}
?>
When the user hits submit the standard e-mail field pops up. I want this e-mail to be hidden from the user and just automatically sent when the user hits join. If I remove the if statement the mail is sent hidden instantly when the page loads, so I feel the error must be in the if statement. Any help is greatly appreciated.