"include" question
| From: | RClark | Date: | Thu, 12 Dec 2002 14:07:05 +0000 |
| Subject: | "include" question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-127995@lists.php.net to get a copy of this message | ||
Hello all,
I am passing a variable like so:
<a href="link.php?foo=bar.php">
On the "link.php" page, I have this simple code:
<?php
$job = $_GET['foo'];
echo "$job"; // for error checking
include 'path/to/$job';
?>
The 'echo "$job";' statement works just fine, but the outbout for the
include statement looks like this:
bar.php
Warning: Failed opening 'scripts/$job' for inclusion
(include_path='.:/usr/local/lib/php') in /usr/local/www/data-dist/link.php
on line 142
Can I not use a $variable in an include 'something.php '; statement?
Thanks in advance,
Ron Clark