SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : The Server :

Previous DiscussionNext Discussion
 php_register_globals ON

Can anyone let me know their views on how simple or difficult it is to use server side includes to overwite the following:

            php_register_globals      ON

            gpc_magic_quotes         ON

The server is a shared server and the host sets these globally. - Cheers

Started By Jockrock on Aug 16, 2006 at 4:41:03 PM

14 Response(s) | Reply

Earlier Replies | Replies 8 to 14 of 14 | Later Replies
Goto Page: 2 1
BachusII on Aug 17, 2006 at 10:47:52 AM (# 8)
This message has been edited.

Nazi has a second meaning. That of someone/somepersons being perceived as adhering to some too strict rules way too much.
Besides, we were agreeing, not vehementely disagreeing.


Jockrock on Aug 17, 2006 at 5:34:11 PM (# 9)

I consider myself duly educated! :)


MHenke on Aug 18, 2006 at 12:50:16 AM (# 10)

> Nazi has a second meaning. That of someone/somepersons being perceived as adhering to some too strict rules way too much.
Besides, we were agreeing, not vehementely disagreeing.

Which possibly makes me a fool around nazi, then.
I hope we don't vehemently disagree that (still) not all of my comments has to be taken serious...  8)


cdrom600 on Aug 18, 2006 at 6:13:31 AM (# 11)

What? Humor in an online environment!  This might clog the Internets' tubes; we'd better get Congress to regulate it ;)

</bad attempt at a joke>


bod1467 on Aug 18, 2006 at 9:27:28 AM (# 12)
This message has been edited.

Any use?

/* Function to strip magic quotes from variables for insertion */
function strip_magic_quotes($arr)
{
    foreach ($arr as $k => $v)
    {
        if (is_array($v))
        {
            $arr[$k] = strip_magic_quotes($v);
        }
        else
        {
            $arr[$k] = stripslashes($v);
        }
    }

    return $arr;
}

if (get_magic_quotes_gpc())
{
    if (!empty($_GET))    { $_GET    = strip_magic_quotes($_GET);    }
    if (!empty($_POST))   { $_POST   = strip_magic_quotes($_POST);   }
    if (!empty($_COOKIE)) { $_COOKIE = strip_magic_quotes($_COOKIE); }
}
/* End of Function to strip magic quotes from variables for insertion */

braveheart on Jan 28, 2007 at 4:01:55 PM (# 13)

Switch BOTH of these settings off, as soon as you can; It doesn't matter if they are set globally as you can change them anyways, on a per script issue via ini_set( ... ); for example,

ini_set( 'register_globals', 'off' ); // or
ini_set( 'register_globals', false );

You can do so with gpc_magic_quotes as well - put the new settings at the top of your script, or keep them all in the same file, and just INCLUDE them.

The script posted above by Bod will also do the trick, but i (strongly) suggest you go the ini route as well :)


Jockrock on Jan 29, 2007 at 3:46:45 AM (# 14)

As you have probably surmised by now.... I am a PHP pygmy... I'll learn it one day (honest).

bod1467 yes it is of use - oddly enough for a different project but I have copied and pasted that. Thanks!

braveheart (this thread has a definate Scottish vein) Thanks for the tip. What would be a surefire way of testing the above example?


Earlier Replies | Replies 8 to 14 of 14 | Later Replies
Goto Page: 2 1

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.