You are here: Re: the script wont work and i cant find anything wrong please help « PHP Programming Language « IT news, forums, messages
Re: the script wont work and i cant find anything wrong please help

Posted by Michael Fesser on 01/16/07 19:14

..oO(plemon)

>so you are saying i should have magic quotes turned on?

No, magic quotes are dead. Turn them off and forget about them.
Thankfully they'll be completely removed in PHP 6.

>im reading up
>more on sql injection at the moment still don't understand it at all.

Never(!) trust any data sent in from a client. URL parameters, POST
data, cookies - everything can easily be faked. This not only applies to
databases, but to everything on a server that deals with user-submitted
data. Validate everything and escape it if necessary!

In the case of DBs you have to make sure that _all_ data that goes into
a DB is properly escaped, so that it's not possible for an attacker to
inject his own SQL commands to wreak havoc on your DB.

In PHP there are two more or less ways to do that:

1) Use DB-specific escaping functions, like mysql_real_escape_string()
for example.

2) Use prepared statements as provided by the PDO extension.

Micha

 

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

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