Variables don't get parsed in single quotes, use double quotes.
RClark wrote:
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
--
The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php