Does anyone know a good "Contact Us" form script? One that is secure and safe?
Announcement
Collapse
No announcement yet.
a good secure 'contact us' form script?
Collapse
X
-
-
Computer Help Forum
An informed rider makes their first destination the motorcycle forum at rider info.
Comment
-
This should work fine...
PHP Code:<?
/***************** CONFIG *******************/
// Your Email Address
$to = '[email protected]';
// Enter a url to redirect to after sending the email if needed
$redirect = '';
/*************** END CONFIG *****************/
// Check to see if form has been submitted
if($_POST['submit'])
{
$from = $_POST['from'];
$subject = stripslashes($_POST['subject']);
$body = stripslashes($_POST['body']);
if($from != '' && $subject != '' && $body != ''){
mail($to, $subject, $body, "From: $from");
if($redirect)
header("Location: $redirect");
else
$message = '<p>Email Sent</p>';
} else {
$message = '<p><font color="red">Please complete ALL fields</font><p>';
}
}
?>
<html>
<head>
<title>Send An Email</title>
</head>
<body>
<?=$message?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
From:<br /> <input type="text" name="from"><br />
Subject:<br /> <input type="text" name="subject"><br />
Message:<br /> <textarea name="body"></textarea><br />
<input type="submit" name="submit" value="Send It!">
</form>
</body>
</html>
Comment
-
Originally posted by MistSecure but someone could kill your server with it. You should have a time limit on thereYou don't want people sending a message every second all day just to try and take down your site.
Comment
-
Originally posted by ABLadyThanks - everyone for their suggestions. What about a cgi script? They don't have to use a database.
Comment
-
Originally posted by N9neYuck, CGI would kill the server if it received just 2 emails a day.
You could store the ip addresses in a text file...
It's a common misconception that CGI is slow. It's only slow if it's coded incorrectly. It can be as fast as PHP when you do it properly.
The benefits of CGI are increased security, and being more established.| DiscBurn | CD & DVD Replication services, film and VHS to DVD, and duplication equipment
| Disc On Demand | Short-run CD & DVD duplication... all online.
Comment
-
Originally posted by Lacrosse BoyNot if it's programmed correctly.
It's a common misconception that CGI is slow. It's only slow if it's coded incorrectly. It can be as fast as PHP when you do it properly.
The benefits of CGI are increased security, and being more established.
Comment
-
People... CGI is not a language. It's a standard for data.
Perl is the most common CGI language. And it's slower than PHP because PHP is usually loaded as a module, unlike Perl. Perl and PHP, when set up similarly, are nearly the same.
Comment
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment