code not working in php 5

liunx

Guest
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";

}


ThanksNeither 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:

<!-- m --><a class="postlink" href="http://uk.php.net/variables.predefined">http://uk.php.net/variables.predefined</a><!-- m -->

Markare u getting any error messages
 
Back
Top