Hi ive got a form that sends a persons e-mail address when they type it into the form and submit it which is what it tis supposed to do but it also send the form info (which is blank) when the page/file loads.
Can anyone tell me how to correct this problem, thanks
This is my php file code:
<?php
// get posted data into local variables
$EmailTo = “
$Subject = “Mailing list”;
$Email = Trim(stripslashes($_POST[‘Email’]));
// prepare email body text
$Body = “”;
$Body .= “Email: “;
$Body .= $Email;
$Body .= “n”;
// send email
$success = mail($EmailTo, $Subject, $Body, “From: <$EmailFrom>”);
?>
<html>
<head>
</head>
<body>
//(some html code here)
<form method=”POST” action=”<?php echo $GLOBALS[“PHP_SELF”]; ?>”>
<p style=”margin-top: 1; margin-bottom: 1″><input type=”text” name=”Email” size=”15″ style=”color: #000000; font-family: Arial; font-size: 11px” value=”Your E-mail address”>
<input type=”submit” value=”Join” name=”B1″ style=”color: #000000; font-family: Arial; font-size: 11px” onClick=”alert(‘Thank you signing up to our mailing list.’); return true”></p>
</form>
</body>
</html>