Re: "include" question

From: Date: Thu, 12 Dec 2002 14:18:20 +0000
Subject: Re: "include" question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-127997@lists.php.net to get a copy of this message
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.

« previous php.general (#127997) next »