PHP include problem

I have a problem like the following:


<?php $check =1; include_once('include.php'); ?>


<?php if ($check <> 1) ... else ... ?>

The problem is $check is always empty.
I cannot pass check variable value from index.php to the included file include.php.
kindly may you tell where is the mistake ?
do i have to change my php.ini or .htaccess setup ?
tks a lot in advance for assistance.


<?php define("check",1); include_once('include.php'); ?>include.php

<?php if(defined("check")) { ... } else { ... } ?>
Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost

If you’re access to the $check variable in include.php is inside a function you can define it as “global” inside the function:

function test ()
global $check;

if ($check == 1)
echo “yes”;