FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP magic_quotes_gpc question





ammonkc
I'm not really clear on when the magic_quotes are applied. php.nets documentation says that it basically addslashes() to any data gotten from a $_GET, $_POST, or cookie. I understand that to mean that if I insert a Post variable into mysql it will addslashes. for example:
Code:
"INSERT INTO table (notes) values ('".$_POST['notes']."')"

but what I want to know is will the magic quotes be passed to other variables?
for example:
Code:
$notes=$_POST['notes'];
"INSERT INTO table (notes) values ('$notes')";


if I first set a regular variable equal to a post or get variable and then insert that into the mysql db, will the magic quotes still be applied to that variable? or should I addslashes() to variables that aren't $_POST or $_GET first?
thank you in advanced.
Related topics
PHP/MySQL question
PHP Editing Question
[PHP] n00b question
Please help with php-quick question
php, css question (wordpress)
php SESSIONS question
votre avie sur mon nv site .
php nuke question
php/sql question
The last foolish PHP/MySQL Question of the Year....
PHP MySQL Question
PHP OCI8 question
PHP Form Question
Newbie PHP/MySQL question
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.