A more secure way to register global on September 9th, 2010, 2:17pm
Home Calendar Search Register Login
Welcome, Guest. Please login or register.

FREE Website Scripts ¦ FREE PHP Website Scripts ¦ Website Scripts for free    General    Register Globals ON or OFF  ›  A more secure way to register global on
Users Browsing Forum
No Members and 1 Guests

 Pages: 1
Recommend Print
  Author    A more secure way to register global on  (currently 1,221 views)
The Management
Posted: February 27th, 2007, 12:15pm Report to Moderator
Administrator Group



Posts: 124
Logged On: 1 days 5 hours 29 minutes
Reputation: 100.00%
A more secure way to register_globals on

Since PHP now automatically switches register_globals OFF, on some PHP scripts this causes a problem, especially if you have written quite a large script.

This snippet should solve the problems whilst remaining secure.

Copy and paste this script into the top of your main index.php file



Code

<?php
// AGTC - Make register_globals on v1.0a
// AGTC Websolution - Visit http://website-scripts.co.uk for more free scripts
if (!ini_get('register_globals')) {
$reg_globals = array($_POST, $_GET, $_FILES, $_ENV, $_SERVER, $_COOKIE);
if (isset($_SESSION)) {
array_unshift($reg_globals, $_SESSION);
}
foreach ($reg_globals as $reg_global) {
extract($reg_global, EXTR_SKIP);
}
}
?> 


Logged Offline
Site e-mail Private Message
 Pages: 1
Recommend Print

Locked Board Board Index    Register Globals ON or OFF  [ previous | next ] Switch to:

Thread Rating
There is currently no rating for this thread
 
Forum Rules
You may not post new threads
You may not post replies
You may not post polls
You may not post attachments
HTML is off
Blah Code is on
Smilies are on

Powered by E-Blah Platinum 9.71B © 2001-2006