Welcome, Guest. Please login or register.
Did you miss your activation email?
05/23/12, 00:14
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  The Library
| |-+  Technical Reference Area (Moderators: Flash-db, Musicman, BurtonRider1983, vesa kortelainen, Ronald Wernecke, Jorge Solis)
| | |-+  upgrading scripts to new PHP
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: upgrading scripts to new PHP  (Read 3304 times)
Musicman
Administrator
Systems Administrator
*****
Posts: 2685



View Profile WWW Email
« on: 12/21/02, 05:06 »

Hi,

as you may know, new PHP (4.1 and later) does no longer make all incoming vriables global, as a security enhancements.
Now, this code snippet should help since it does the work and at the same time documents which vars are expected:
// variables that might come in via querystring
$get_vars = array("action");
// variables that might come in via post
$post_vars = array("user", "password", "email");
// the actual code
foreach ($get_vars as $v)
 if(isset($_GET[$v]))
   $$v = $_GET[$v];
foreach($post_vars as $v)
 if(isset($_POST[$v]))
   $$v = $_POST[$v];

You still hve to identify those vars first, unless the script was nicely documented already Smiley

Musicman
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything