Here's the form I am using. When a user input the email address in the form below ...how do I change it so that the email address is saved in a file or mailed to me? <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']);?>" method="post"> <input type="text" name="email" value="<?php echo htmlspecialchars($email); ?>"><br> <input type="submit"> </form> Code (markup):
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']);?>" method="post"> <input type="text" name="email" value="<?php echo htmlspecialchars($email); ?>"><br> <input type="submit" name="submit"> </form> <?php if(isset($_REQUEST['submit'])) { $to = $_REQUEST['email']; $subject = 'the subject'; $message = 'hello'; $headers = 'From: ' . "\r\n" . 'Reply-To: ' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); } ?> this is the sample script