note 87833 deleted from security.globals by danbrown
| From: | danbrown@php.net | Date: | Fri, 26 Dec 2008 16:46:35 +0000 |
| Subject: | note 87833 deleted from security.globals by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-148536@lists.php.net to get a copy of this message | ||
Note Submitter: Robert
----
-greetz subarea-
I was looking at this post that you put here, and I am needing some help in getting this done. I
use Joomla as part of my content building on my website and I host my website via Yahoo. I dont
have the persmissions to any of the PHP settings, nor can I add a .htaccess in my root folder
(don't have the persmissions as well). I was reading this as a work around for me, but I
don't know where to put this code within my Joomla website. Are you familiar with Joomla at
all?
Any help would be greatfull. My email is rblynes@yahoo.com
Thanks,
Robert
========
your webspace provider has register-globals activated by standard and you don't have a chance
to turn it off? no problem anymore, here is your solution...
<?php
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
// this is just a workaround to kill all through register globals imported vars!
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
// place this script after session_start() to be sure you unregister_globals('_SESSION');
// that's all, now all through "register_globals" assigned vars are deleted from
scope.
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
if (ini_get('register_globals') == 1)
{
if (is_array($_REQUEST)) foreach(array_keys($_REQUEST) as $var_to_kill) unset($$var_to_kill);
if (is_array($_SESSION)) foreach(array_keys($_SESSION) as $var_to_kill) unset($$var_to_kill);
if (is_array($_SERVER)) foreach(array_keys($_SERVER) as $var_to_kill) unset($$var_to_kill);
unset($var_to_kill);
}
?>
hope you like it ;)
greetz subarea