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 : Make your PHP 4.1 (or higher) script compatible with PHP 4.0 (still used by some prviders)
Categories : PHP, PHP Options and Info, Variables Click here to Update Your Picture
Ulrich Kapp
Date : May 22nd 2003
Grade : 1 of 5 (graded 3 times)
Viewed : 4979
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Ulrich Kapp
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?php
// PHP4 < 4.1 Compatibility
if (!function_exists('version_compare')) {
    function
version_compare ($a, $b, $c) {
        return (
TRUE);
    }
}
if (
version_compare(phpversion(), "4.1.0", "<")) {
   
$_SERVER = $HTTP_SERVER_VARS;
   
$_REQUEST = array_merge ($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS);
   
$_GET = $HTTP_GET_VARS;
   
$_POST = $HTTP_POST_VARS;
   
$_COOKIE = $HTTP_COOKIE_VARS;
   
$_FILES = $HTTP_POST_FILES;
   
$_SESSION = $HTTP_SESSION_VARS;
   
$_ENV = $HTTP_ENV_VARS;
}
// End PHP4 < 4.1 Compatibility
?>



Pageinfo: Array containing page URI, page query string (parameters), request method (GET or POST) and the complete URI
Categories : Variables, PHP Options and Info, Arrays, URLs, PHP
How to pass an array to a function, or how to define a function wich recieves an array.
Categories : Variables, PHP, Arrays
Automatic global variable definer
Categories : PHP, Variables, Beginner Guides
Display variables when a form is submitted using POST/GET
Categories : PHP, Functions, Variables, Debugging
Check parameters validity. Paranoia was designed to check the validity of the parameters that a php page will receive after a form submission. It can be used to check the variables sent by POST or GET
Categories : Algorithms, HTML and PHP, PHP, Variables
PHP, simple, counter, bala
Categories : HTML and PHP, PHP, PHP Options and Info
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
PhpView 0.1 - simple php viewer, using temporary files and frames.
Categories : PHP, PHP Options and Info, Debugging, HTML and PHP
Functions to read a template file and fill in PHP variables. It will also fill in array variables, displaying parts of the template multiple times.
Categories : PHP, Variables, Filesystem
PHP Dump in html format the contents of one array variable with a recursive list of the nested array variables inside.
Categories : PHP, Arrays, Variables
Initialize global variables for every field in a table. This version requires that phplib is installed on your server.
Categories : Global Variables, MySQL, PHP, Variables
A database abstraction layer for the PHP Oracle 8 module (available from PHP 3.0.5). It supports persistent connections, fetching rows into arrays, prepare/execute (variable binding) and has a new and improved error interface.
Categories : Databases, Oracle, PHP, Arrays, Variables
Dump the contents of a PHP variable in html format with a recursive list of subfolders and files from a given root directory.
Categories : PHP, Directories, Variables, Arrays
How to display a PHP variable value from a selectbox without reloading the page by merging PHP and Javascript variables.
Categories : PHP, Java Script, Variables
This functions compares the current PHP version with a desired version. Because of the 3 tiered version system, a direct compare of a string to phpversion() will not be accurate.
Categories : PHP Configuration, PHP, Variables
 Justin French wrote :973
You aren`t REALLY ensuring compatability of an entire script, just the $_SERVER (etc) arrays.

There is still one LARGE difference however.  $_SERVER, $_POST, etc are all superglobal arrays, which means you don`t have to do things like:

function foo()
  {
  global $_SERVER;
  }

In your example, the user would still have to have a global ... statement in any user functions they declared.

Your example solves a LOT of problems, but not all :)