Click to See Complete Forum and Search --> : Checkin for a file


Vasilli
07-21-2003, 01:24 AM
Hi all,

Will start form the top

I am building a site that checks directories to see if files are present, if so it will include them into the page. What i am trying to do is to CHECK first to see if a particular file (NEXT_PAGE.php) is in that directory, and if it is, include it at the bottom of the page (which i have already done), But then again if it isn't present, don't include it and don't return errors telling me it isn't present either.

i hope i have made sense. Thank you for our time!

Jono

badda
07-21-2003, 02:22 AM
Try opening the file. If opening the file succeeds, it exists :D

Kr|Z
07-21-2003, 04:36 AM
if(file_exists("NEXT_PAGE.php") {
include("NEXT_PAGE.php");
}

Vasilli
07-21-2003, 06:10 PM
Kr|Z.... Mate, thanks for the help, I am running Apache2 soe it didn't work, but i was trolling round the PHP.net site and found this: (Just thought i would let everyone know, coz i know i spent alot of time trying to figure out why your code didn't work, i had already tried it b4 you posted and it didn't work. The one below does?? Go figure??)


if (is_file('./NEXT_PAGE.php')) {
include './NEXT_PAGE.php';
}

Thank for your help, it is appreciated mate!!

Jono