PDA

View Full Version : How to avoid a php file to be evaluated


cdc08x
10-17-2005, 12:19 PM
I'm printing on video the remote file system on a website.
To make the files be downloaded, I create an anchor to everyone giving their position in the document root to be opened as "href" attribute.
The problem is that if there's a php file, it gets evaluated by the server, while I don't want it.
Is there a way not to have this side-effect?

Thanks a lot!!

mrruben5
10-17-2005, 01:56 PM
You could do this:

$file=file("bla.php");
foreach ($file as $line) {
echo $line;
}

or, with php5:

echo file_get_contents("bla.php");

cdc08x
10-17-2005, 02:17 PM
Ok that's great if I want to make a file be viewed!! Thanx a lot!

Is there a way to force the client to see the "download request" window appear? (the famous Open With / Download message dialog)?

Thank you!!!!