Fw: [PHP] Variables that work before the include file but not after....
| From: | Rick Emery | Date: | Wed, 23 Oct 2002 17:16:01 +0000 |
| Subject: | Fw: [PHP] Variables that work before the include file but not after.... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-121135@lists.php.net to get a copy of this message | ||
When you printed from the include file, were you in a function? If so, you must declare $test as
GLOBAL
----- Original Message -----
From: "Scott Fletcher" <scott@abcoa.com>
To: <>
Sent: Wednesday, October 23, 2002 11:22 AM
Subject: [PHP] Variables that work before the include file but not after....
Hi Everyone!
I'm a little baffled. When I assigned the data to the variable and echo
it, it showed the data. Then I continue on to the include file, so inside
that file, when I echo the variable, it showed a blank. Why is that?
--clip--
$test = "Testing!!!!";
echo $test;
include('file1.php');
--clip--
--clip-- (file1.php)
echo $test;
--clip--
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php