reading a file into a string problem : $string = join ('', file (/location/$dynamic.iq))
| From: | Lee Philip Reilly | Date: | Wed, 19 Dec 2001 18:10:13 +0000 |
| Subject: | reading a file into a string problem : $string = join ('', file (/location/$dynamic.iq)) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-78233@lists.php.net to get a copy of this message | ||
Hi,
I wonder if someone can help me solve this niggling problem:
I have a hyperlink
[javascript:openwindow('http:myserver/files.php?expid=67.iq')],
which
passes the argument 'expid' to the PHP script, where 'expid' is the name
of a file.
I want to take the file data and put it into a string. When I do so by
naming the file in the script it works fine e.g.
$fcontents = join ('', file ('myserbver/files/67.iq'));
But when I do
$fcontents = join ('', file ('myserver/files/$expid'));
// where $expid = 67.iq
I get the following errors
-----------
Warning: file("myserver/files/$expid") - No error in c:\program
files\apache group\apache\htdocs\sasdap\v5\files.php on line 4
Warning: Bad arguments to join() in c:\program files\apache
group\apache\htdocs\sasdap\v5\files.php on line 4
-----------
I've also tried
$file_location="myserver/files/$expid";
$fcontents = join ('', file ('$file_location'));
I'm new to PHP and am so far only working with the online documentation.
Can anyone help and/or explain the problem?
Thanks in advance ;-)
- Best regards,
Lee