PHP Developers Network
http://forums.devnetwork.net/

Secure 1 field php form - help
http://forums.devnetwork.net/viewtopic.php?f=34&t=135140
Page 1 of 1

Author:  Davidjohny [ Thu Apr 05, 2012 12:28 pm ]
Post subject:  Secure 1 field php form - help

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>

<input name="email" type="text" id="email" />


<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
============

Author:  social_experiment [ Thu Apr 05, 2012 6:09 pm ]
Post subject:  Re: Secure 1 field php form - help


Author:  Celauran [ Thu Apr 05, 2012 6:14 pm ]
Post subject:  Re: Secure 1 field php form - help


Author:  social_experiment [ Fri Apr 06, 2012 12:30 am ]
Post subject:  Re: Secure 1 field php form - help


Author:  Celauran [ Fri Apr 06, 2012 6:31 am ]
Post subject:  Re: Secure 1 field php form - help

A simple honeypot can consist of a form field hidden by CSS. Humans won't see it, so they won't fill it in. Bots will see it, however, and tend to fill in everything. If that field contains data, discard the post.

Author:  social_experiment [ Fri Apr 06, 2012 5:28 pm ]
Post subject:  Re: Secure 1 field php form - help

Ah ok; thanks for the idea :)

Author:  Gopesh [ Thu Apr 26, 2012 7:37 am ]
Post subject:  Re: Secure 1 field php form - help

Thanks Celauran for the idea of honeypot..:D

Author:  x_mutatis_mutandis_x [ Thu Apr 26, 2012 10:07 am ]
Post subject:  Re: Secure 1 field php form - help


Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/