Secure 1 field php form - help
Posted: Thu Apr 05, 2012 12:28 pm
Hello
I have a website with an online email newsletter subscription form in PHP.
Current status:
Step1/- A visitor fills in his email address.
Step 2/- Next, I get visitor email address inside my INBOX.
Current PHP form consist of two pages
================================================
[[[ Page with PHP Form Code | Page NO.1 Formpage.php ]]]
<html><body>
<form name="myform" method="post" action="SEND.php"><br> <br />
<input name="email" type="text" id="email" />
<br />
<input type="submit" name="Submit" value="Submit" />
</form>
</body></html>
================================================
[[[ Confirmation Page Code | Page NO.2 SEND.php ]]]
<?php
$email = $_REQUEST['email'] ;
mail( "myemail@mydomain.com", "Newsletter Request", "From: $email" );
?>
================================================
I have heard about php code injection, malicious script and spam.
How can I secure this simple php two pages form?
Best wishes,
Dave
============
I have a website with an online email newsletter subscription form in PHP.
Current status:
Step1/- A visitor fills in his email address.
Step 2/- Next, I get visitor email address inside my INBOX.
Current PHP form consist of two pages
================================================
[[[ Page with PHP Form Code | Page NO.1 Formpage.php ]]]
<html><body>
<form name="myform" method="post" action="SEND.php"><br> <br />
<input name="email" type="text" id="email" />
<br />
<input type="submit" name="Submit" value="Submit" />
</form>
</body></html>
================================================
[[[ Confirmation Page Code | Page NO.2 SEND.php ]]]
<?php
$email = $_REQUEST['email'] ;
mail( "myemail@mydomain.com", "Newsletter Request", "From: $email" );
?>
================================================
I have heard about php code injection, malicious script and spam.
How can I secure this simple php two pages form?
Best wishes,
Dave
============