chestertb
06-02-2004, 08:40 AM
Hi all,
I know that I can include a file, and extract variables from it to use in the parent.
However, can I include a file, and use variables from the parent to perform calculations within the included code segment?
Example...
I have a file, test.php as follows;
<html>
<head>
</head>
<body>
<?php
$test = "Yay... it works!";
include('http://www.somedomain.com/test.inc.php');
?>
</body>
</html>
and test.inc.php is as follows;
<?php
print "This works!
And just to prove it, here is the value of ".$test.".
";
?>
Unfortunately, it doesn't read the value of $test into the external file. Is there a way to do that?
CTB
I know that I can include a file, and extract variables from it to use in the parent.
However, can I include a file, and use variables from the parent to perform calculations within the included code segment?
Example...
I have a file, test.php as follows;
<html>
<head>
</head>
<body>
<?php
$test = "Yay... it works!";
include('http://www.somedomain.com/test.inc.php');
?>
</body>
</html>
and test.inc.php is as follows;
<?php
print "This works!
And just to prove it, here is the value of ".$test.".
";
?>
Unfortunately, it doesn't read the value of $test into the external file. Is there a way to do that?
CTB