WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Automatic global variable definer
Categories : PHP, Variables, Beginner Guides Click here to Update Your Picture
Fabien HADDADI
Date : Aug 09th 2005
Grade : 1 of 5 (graded 5 times)
Viewed : 8430
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Fabien HADDADI
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

The following can be an include file (eg set.ini), and be called at the top of every page in case you knowingly* want all the global variables passed on the URL to be defined as global variables and don't know if your target webserver(s) will have the auto global variable parameter turned on when the code is executed.

<?php
if($_SERVER['REQUEST_METHOD'] == "GET" )
{
       
reset ($_GET);
        while (list (
$key, $val) = each ($_GET)) $$key=$val;
}
else
{
       
reset ($_POST);
        while (list (
$key, $val) = each ($_POST)) $$key=$val;
}
?>



*Attention, it may be unsecure to have this behaviour though.



Newbie Notes #5 - To double quote, or single quote, that is the question
Categories : PHP, Beginner Guides, Variables
PHP Event Logger
Categories : PHP, Log Files, Errors and Logging, Beginner Guides
Display variables when a form is submitted using POST/GET
Categories : PHP, Functions, Variables, Debugging
Sending mail to a mailing list and showing progress
Categories : PHP, Mail, Beginner Guides
Add, Edit /Update & Delete all in one Contact Management Form
Categories : PHP, MySQL, Databases, Beginner Guides
Kewl Date Example
Categories : PHP, HTML and PHP, Date Time, CSS, Beginner Guides
mySQL/PHP/search with multientry form and table output with colored rows
Categories : PHP, Beginner Guides, MySQL, HTML and PHP, Databases
Newbie Notes #3 - What went wrong? A useful little debugging aid
Categories : PHP, Beginner Guides, Debugging
A class to put get and post variables in hidden form elements. Works on scalars, normal arrays, associative arrays.
Categories : Algorithms, Variables, Arrays, PHP, PHP Classes
A beginner's session handling class
Categories : PHP, PHP Classes, Sessions, Beginner Guides
PHP based HTML rabbing Tools
Categories : PHP, HTML and PHP, Tag Extractors, Regexps, Beginner Guides
PHP Image Validation Class - test if a specific file is of a certain image type without relying on the said file extension.
Categories : PHP, PHP Classes, Data Validation, Graphics, Beginner Guides
Form Submission Using Array's
Categories : PHP, HTML and PHP, Beginner Guides, Arrays
How to pass an array to a function, or how to define a function wich recieves an array.
Categories : Variables, PHP, Arrays
Using PHP im HTML image tags
Categories : PHP, HTML and PHP, Graphics, Beginner Guides