Hello again, on december 2012, I was porting my old php code (php4) to new php 5.4.3. There are to many errors within code, especially for session, eregi, global variables and others. This some pieces step for compatibility porting:
add global variable definiton on some function that need outside variable <code> function getuser(){ global $loginid,$password; } </code>
replace eregi(/find/,str) with preg_match(//,str)
add function exists for function that not exists in php5.4.3. for example: <code> if(!function_exists("session_is_registered")){ function session_is_registered($var){ return isset($_SESSION[$var]); } } if(!function_exists("session_register")){ function session_register($var){ $_SESSION[$var]=$_GLOBALS[$var]; } } </code>
Ok there is my tips, how about you?
1 2 3 4 5 6 7 8 9 10 11 12 | /*code for session compatibility*/
if(!function_exists("session_is_registered")){
function session_is_registered($var){
return isset($_SESSION[$var]);
}
}
if(!function_exists("session_register")){
function session_register($var){
$_SESSION[$var]=$_GLOBALS[$var];
}
}
|