V Posted June 8, 2010 Share Posted June 8, 2010 Hello all! I'm just about done making a contact form but I'm concerned about email injection attacks I use javascript validation for valid email and if(isset($_POST['submit'])) in my php to prevent direct access. I'm not sure how to make it more injection-proof. My entire php code is here http://www.phpriot.com/2912 Do you think it's alright? :-\ Link to comment https://forums.phpfreaks.com/topic/204202-prevent-email-injections/ Share on other sites More sharing options...
F1Fan Posted June 8, 2010 Share Posted June 8, 2010 You'll have to post your PHP code for us to answer that. What are you doing with the data? Inserting into a DB or what? Link to comment https://forums.phpfreaks.com/topic/204202-prevent-email-injections/#findComment-1069550 Share on other sites More sharing options...
V Posted June 8, 2010 Author Share Posted June 8, 2010 Hi F1Fan, I posted a link above to the php code http://www.phpriot.com/2912 I'm sending the data to my email and also displaying in the success page using <p>Your massage has been sent.</p> <p><?php echo nl2br($mailcontent); ?> </p> Link to comment https://forums.phpfreaks.com/topic/204202-prevent-email-injections/#findComment-1069552 Share on other sites More sharing options...
kenrbnsn Posted June 8, 2010 Share Posted June 8, 2010 Read Email Header Injection Exploit written in 2005. BTW, Javascript can be turned off and your form can be submitted by bots, so always do validation with PHP on the server. Ken Link to comment https://forums.phpfreaks.com/topic/204202-prevent-email-injections/#findComment-1069553 Share on other sites More sharing options...
V Posted June 8, 2010 Author Share Posted June 8, 2010 Read Email Header Injection Exploit written in 2005. BTW, Javascript can be turned off and your form can be submitted by bots, so always do validation with PHP on the server. Ken ooh! good point! thanks! Link to comment https://forums.phpfreaks.com/topic/204202-prevent-email-injections/#findComment-1069554 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.