You are here: Re: Strategy for securing MySQL PHP application - please comment « PHP Programming Language « IT news, forums, messages
Re: Strategy for securing MySQL PHP application - please comment

Posted by Rik on 07/04/06 18:34

Harold Crump wrote:
> Greetings,
>
> I have a fairly vanilla PHP web application that stores and retrieves
> data in a MySQL database.
> Users will be adding a lot of special characters such as single and
> double quotes, accented French characters, etc.
>
> I want to eliminate any potential for XSS or SQL injection attacks.
>
> My question - is it enough to pass all user input through the
> htmlentities() function call and store the resultant output?

No. Use mysql_real_escape_string(), allthough that's not a 100% secure
either:
http://ilia.ws/archives/103-mysql_real_escape_string-versus-Prepared-Statements.html

Prepared statements seem the way to go. Use mysqli if available.

> Also, I would like to replace all semi-colons in input with something
> else - but I am not sure what and how.

Why?

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация