View Full Version : Safest way
Surrix
Fri 2nd Jan '04, 4:43pm
Currently I have a few forums that need to be submitted what is the safest way to get that data into php. Right now I have it all as POSTS and I know I can use $_POST['name'] to get that data but is that the safest way?
CeleronXT
Sat 3rd Jan '04, 10:57am
Currently I have a few forums that need to be submitted what is the safest way to get that data into php. Right now I have it all as POSTS and I know I can use $_POST['name'] to get that data but is that the safest way?If you're storing it in mySQL, run it through mysql_escape_string() or addlashes() before insertion, and that should be all you need.
equin0x
Sat 17th Jan '04, 11:35am
addlashes()
addslashes() is the correctly spelled name for this function, just correcting since you'd get a pretty funny looking error if you used addlashes() ;)
Raz Meister
Sat 17th Jan '04, 2:27pm
Currently I have a few forums that need to be submitted what is the safest way to get that data into php. Right now I have it all as POSTS and I know I can use $_POST['name'] to get that data but is that the safest way?
Yes, that is the prefered method, and works even if register_globals is set to off.
However, that global variable is not available in older versions of PHP.
vBulletin® v3.8.0 Beta 3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.