By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,375 Members | 1,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,375 IT Pros & Developers. It's quick & easy.

magic quotes and register globals

P: n/a
even though register globals is disabled by default, i'm currious as to
how it and magic quotes interact. consider the following code:

<?
// assuming $_GET['var']='"test"' and register globals enabled
echo $var;
?>

will the output be "test" or \"test\"?

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
First of all, magic quotes and register globals have nothing to do with
each other. If register globals was enabled in your example above, a
variable $var would automatically available. If register globals is
disabled, it won't be available as $var, but rather as $_GET['var'] (or
$_POST['var'], etc.).

If you have magic_quotes_gpc enabled, your example will output \"test\"
regardless of the register globals setting.

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.