[RESOLVED] PHP Form Issue
Hi all,
Just wondering if someone could possibly help me with the following:
I have a simple web form:
Code:
<form id="form1" action="" name="form1" class="form" method="post">
<p class="textarea"><input type="text" name="email" value="email address"/>
<input type="submit" name="button" id="button" value="Submit" />
</form>
And at the very top of the page I have the following PHP code:
<?php
$to = "[email protected]";
$subject = "Contact Us";
$email = $_REQUEST['email'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
?>
The problem that I have is that the form is sending me emails even when the page has simply been loaded (less the users email). Can somebody please assist me in resolving this.
Many thanks