Click to See Complete Forum and Search --> : code not working in php 5


pedroz
01-15-2007, 11:37 AM
It used to work on php 4 but not on php 5.2


$forums = ($action == 'forums' && $batch == 'index');

if (!$forums){

echo "yes;"

}else{

echo "no";

}


Any idea to adapt it to php 5.2?


I know I can use the code below but I have several code and I do not want to change it...



if (!($action == 'forums' && $batch == 'index')){

echo "yes;"

}else{

echo "no";

}


Thanks

MarkR
01-15-2007, 01:50 PM
Neither of the above has anything specific to PHP4 or 5 in it.

I expect your problem is that you're expecting register_globals to be enabled, yet it is not. The solution is to use the appropriate superglobal, as explained in the manual link below:

http://uk.php.net/variables.predefined

Mark

scrupul0us
01-16-2007, 10:56 AM
are u getting any error messages