php forgetting variables very easily

From: Date: Tue, 04 Mar 2003 18:37:19 +0000
Subject: php forgetting variables very easily
Groups: php.general 
Request: Send a blank email to php-general+get-138145@lists.php.net to get a copy of this message
Hi everyone.I am probably doing something obviously wrong but I can't seem to sort it! It's regarding variables.In one script, lets call it main.php I make a variable- say $colour. It inludes a file which prints the variable: main.php <?php $colour = 'green'; include('new.php') ?> new.php <?php echo $colour ?> Ok, this works fine for me. However it doesn't seem to work when main.php and new.php have html in them. The variable seems to be lost and new.php prints nothing. Has anyone got any words of wisdom on this? It may help if I actually showed the two pages here, but they are long and I thought it would be a waste of space. Best wishes, Ian ===== --------------------------------- Ian A. Gray Manchester, UK Telephone: +44 (0) 161 224 1635 - Fax: +44 (0) 870 135 0061 - Mobile: +44 (0) 7900 996 328 US Fax no.: 707-885-3582 E-mail: ian.gray@dunelm.org.uk - Websites: www.baritone.uk.com (performance) & www.vocalstudio.co.uk (Tuition) --------------------------------- __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com

« previous php.general (#138145) next »