View Single Post
  #5 (permalink)  
Old February 18th, 2004, 02:34 PM
sami sami is offline
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Rich,
Thanks for pointing out the $HTTP_*_VARS future compatability problem, but I have to code like this as my host is running 4.06. I know you have commented on this before here:

http://p2p.wrox.com/topic.asp?TOPIC_ID=6147

with a solution, but am unsure how (or where) to implement your code:

<?php

if (phpversion() <= '4.1.0')
{
    if (isset($HTTP_GET_VARS)) $_GET = $HTTP_GET_VARS;
    if (isset($HTTP_POST_VARS)) $_POST = $HTTP_POST_VARS;
    if (isset($HTTP_COOKIE_VARS)) $_COOKIE = $HTTP_COOKIE_VARS;
    if (isset($HTTP_POST_FILES)) $_FILES = $HTTP_POST_FILES;
    if (isset($HTTP_SESSION_VARS)) $_SESSION = $HTTP_SESSION_VARS;
    if (isset($HTTP_SERVER_VARS)) $_SERVER = $HTTP_SERVER_VARS;
    if (isset($HTTP_ENV_VARS)) $_ENV = $HTTP_ENV_VARS;

# No need to recreate the $GLOBALS var, has existed since PHP 3
}

?>

in order to preserve portability should I use this in an include file or place at the start of every piece of php code?

Back to the point, I was making Knight aware that he needed to check for the existence of a variable using 'isset' before 'echoing' the result.

Sami
Reply With Quote