For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > February 2005 > Re: [PHP-DB] fread()









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] fread()
Anirudh Dutt

2005-02-21, 8:56 am

u'll get actual the _contents_ of the file, not the 'html content'. so
even if it's a .php, u'll get it's source...it wouldn't be parsed by
the webserver. it'd be like "cat /usr/local/something.php" (as long as
the web server running ur script has read access to the file).

if it's not a local file, the target web server will parse it and then
u'd get the html content, if any.

u may want to check out
file_get_contents

(PHP 4 >= 4.3.0, PHP 5)
file_get_contents -- Reads entire file into a string

http://www.php.net/manual/en/functi...et-contents.php


On Mon, 21 Feb 2005 02:12:37 -0800 (PST), Yemi Obembe
<fickledreams@yahoo.com> wrote:
> Hi All,
> I'd just like to know if it is possible to use fread to read the html content of a serverside coded page....as in something like this:
>
> <?php
> $filename = "/usr/local/something.php";
> $handle = fopen($filename, "r");
> $contents = fread($handle, filesize($filename));
> fclose($handle);
> ?>



--
]#
Anirudh Dutt


....pilot of the storm who leaves no trace
like thoughts inside a dream
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com