variables outside included files on local machine


I have a problem with variables outside included files on my Mac.

I’m using MAMP and PHP version 5.2.11.

In my index.php, I made $id which variable receives from url variable using $_GET method.

like $id = $_GET[‘id’];

and I included nav.php using ‘include_once()’, and inside nav.php

I tried to read outside variable $id,

like if($home == $id) { echo “style=“color:white;””; }.

$home was created inside nav.php.

actually it works on remote server, but it is not working on my local machine.

what is the problem?? anyone plz help me.

thanks in advance.

Sponsor our Newsletter | Privacy Policy | Terms of Service