If you dont need validation - its pretty easy to make a formmail script..
The following script performs no validation at all, and it mails whatever input it receives from the form. Pretty basic, but have been useful for others in the past.
$email should be your own email, $thanksurl is a url to the page which the script redirects to, after mailing the info the $email. (A thanks for the feedback-page).
Feel free to use it.
PHP Code:
<?php
$email = 'dennis@moellegaard.dk.invalid'; // Change me
$thanksurl = '/thanks.html'; // Change me
if( count($_POST) > 0 ) {
$message = 'Feedback from ' . $_SERVER['PHP_SELF'] . "\n\n";
foreach(array('topic','email','message') as $field ) {
$message .= "$field:\n\t{$_POST[$field]}\n\n";
}
$message .= "Remote addr: {$_SERVER['REMOTE_ADDR']}\n";
mail($email,'Homepage feedback', $message );
header('Location: ' . $thanksurl);
exit;
}
?>
<h1>Contact</h1>
<p>Send an email from here, please remember to enter a valid email.</p>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table>
<tr>
<td>Topic</td>
<td><input class="inputbox" name="topic" maxlength="30"></td>
</tr>
<tr>
<td>Your email</td>
<td><input class="inputbox" name="email" maxlength="30"></td>
</tr>
<tr>
<td valig="top">Message</td>
<td><textarea class="inputbox" name="message" rows="10" cols="20"></textarea></td>
</tr>
<tr>
<td></td>
<td><input class="button" type="submit" value="Send"></td>
</tr>
</table>
</form>
|