Forum Moderators: coopster

Message Too Old, No Replies

variables in an included file

variables in an included file

         

ycs334

10:34 pm on Mar 26, 2004 (gmt 0)


Hi, ya all. I just started PHP so don't get hard on me, please.

Here is an example :

--------------------------------------
a.php
<?
echo " <a herf=c.php?value=10>Click</a>";
?>
--------------------------------------

b.php
<?
echo $value;
echo "this is b.php";
?>
--------------------------------------

c.php
<?
$value = $_GET[value];
echo $value; //to comfirm that we GET the value. and of course, the variable comes to this point.

include "b.php";
?>
---------------------------------------

Let say I click the link on a.php then the result is below
--------------------
10

this is b.php
--------------------

I can NOT use the value within the included file(b.php). Is there any way to get it? I tried <? global $value;> and it didn't work. Some may say "What the hack are you talking about?" I know this works for lots of people but it obviously doesn't work for me.

I use Win XP home, Apache 1.3.29, zend egine 1.3.0, zend optimizer 2.5.1, php 4.3.4. If those codes works for you please let me know your server's versions.

tomda

10:58 pm on Mar 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, it works fine for me.
Apache 1.3.27 and Php 4.3.3 - Zend Engine v1.3.0 with Global off.

BTW, I got an error message in c.php and had to replace this line $value = $_GET['value'];