In all actuality I will be manipulating the information that is in that file.

I'm trying to build a log in script.  The id's and passwords are stored in a
text file.  I'm trying to read that text file so I can compare what the
user/viewer had typed in the id and password boxes.  I'm so new to PHP I'm
taking it in baby steps...

Philip Olson wrote:

> On Mon, 27 Jan 2003, Guru Geek wrote:
>
> > Sorry, here is the code now ( I need a nap )
> >
> > $filename
> > ="/usr/local/plesk/apache/vhosts/myserver.com/httpdocs/include/text.txt";
> > $handle = fopen ($filename, "r");
> > $contents = fread ($handle, filesize ($filename));
> > fclose ($handle);
> > echo $contents;
> > exit;
>
> For something like this, just use readfile() and not fread
> as it'd be much more efficient if you don't actually manipulate
> the string $contents.  So:
>
>   readfile($filename);  // note: do not use echo
>
> Also, what is your include_path setting?  It's important
> you know it and what it means as that'll answer the
> question in your last post:
>
>   print ini_get('include_path');
>   http://www.php.net/manual/configuration.directives.php#ini.include-path
>
> Also, no need for "exit" here as that happens automatically.
>
> Regards,
> Philip



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to