communication
 databases
 directories
 file handling
 html and code
 image editing
 image listing
 sessions and co
 string handling
 information
 forms
 apple stuff
 image handling
 array handling
 lixlpixel
php - snippets
google search terms detected and highlighted.
remove highlighting | keep highlighting
make snippet in "html and code" - download "extract vars"
 search
php - snippets

Valid CSS!

php webring logo
prev next
random list
join the Ring!

html and code - extract vars was created/last modified on Fri 19 Mar 2004 6:36 PM

this helps if you want to make these old scripts working with register globals off ...

since PHP version 4.2 you can't get POST or GET variables like you could in the old versions.
So to use your old scripts you either would have to rewrite the whole thing (which would be the more secure solution), but sometimes this is a lengthy procedure.
This is where this snippet jumps in.
Place this on top of all the files and it will get your variables.

  <?
   
if(phpversion() >= "4.2.0")
   {
    
extract($_POST);
    
extract($_GET);
    
extract($_SERVER);
    
extract($_ENV);
    
extract($_COOKIE);
   }
   
?>   

learn more about some of the PHP functions used in this snippet: extract, file, glob, global, phpversion, time, var

view the GNU general license - view the GNU library license - search on PHPsnippets - see your code like this

 a lixlpixel.com site

PHParadise.com - PHP-classes.org - your site on safari