Thanks!  Works perfect with double quotes!

RC


-----Original Message-----
From: Tom Rogers [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 12, 2002 8:21 AM
To: Ronald Clark
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] "include" question


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: 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


CONFIDENTIALITY NOTICE:

************************************************************************

The information contained in this ELECTRONIC MAIL transmission
is confidential.  It may also be privileged work product or proprietary
information. This information is intended for the exclusive use of the
addressee(s).  If you are not the intended recipient, you are hereby
notified that any use, disclosure, dissemination, distribution [other
than to the addressee(s)], copying or taking of any action because
of this information is strictly prohibited.

************************************************************************

Reply via email to