02-27-2010, 06:35 PM
I want to make sure my html form is secure (if it's even possible) to prevent any information from being stolen, so please review my html form code and I'll also post up my form processor.
xhtml:
php:
xhtml:
Code:
<form name="contact" enctype="multipart/form-data" action="contact.php" method="post" onsubmit="return validate_fields(this)">
<ul>
<li>Name:<br />
<input type="text" size="30" name="name" id="name" /></li>
<li><br /></li>
<li>Email:<br />
<input type="text" size="30" name="email" id="email" /></li>
<li><br /></li>
<li>Problem:<br />
<select name="problem">
<option value="website">Website Problem</option>
<option value="forum">Forum Problem</option>
<option value="misc">Miscellaneous</option>
</select></li>
<li><br /></li>
<li>Comments:<br />
<textarea name="comments" id="comments" rows="5" cols="45"></textarea></li>
<li><br /></li>
<li><input type="submit" name="submit" value="Submit" />
<input type="reset" name="reset" value="Reset" /></li>
</ul>
</form>
[/html]
php:
Code:
<?php
$name = $_POST["name"];
$email = $_POST["email"];
$problem = $_POST["problem"];
$comments = $_POST["comments"];
$address_to = "removed for privacy";
$address_from = "removed for privacy";
$email_subject_line = $name . "'s form";
$email_text = "Name? " . $name .
"\nEmail? " . $email .
"\nProblem? " . $problem .
"\nComments? " . $comments;
mail($address_to, $email_subject_line, $email_text, $address_from);
?>