Hi,

Friday, December 13, 2002, 12:07:05 AM, you wrote:
R> Hello all,

R> I am passing a variable like so:
R> <a href="link.php?foo=bar.php">

R> On the "link.php" page, I have this simple code:
R> <?php
R> $job = $_GET['foo'];
R> echo "$job";   // for error checking
R> include 'path/to/$job';
?>>

R> The 'echo "$job";' statement works just fine, but the outbout for the
R> include statement looks like this:
R> bar.php
R> Warning: Failed opening 'scripts/$job' for inclusion
R> (include_path='.:/usr/local/lib/php') in /usr/local/www/data-dist/link.php
R> on line 142

R> Can I not use a $variable in an include 'something.php '; statement?

R> Thanks in advance,
R> Ron Clark


You have to use double quotes like:
include "path/to/$job"

or add like this:

include 'path/to/'.$job

-- 
regards,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to