www.webdeveloper.com
Results 1 to 4 of 4

Thread: Checkin for a file

  1. #1
    Join Date
    Jun 2003
    Location
    Brisbane, Australia
    Posts
    53

    Checkin for a file

    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

  2. #2
    Join Date
    Jul 2003
    Posts
    9
    Try opening the file. If opening the file succeeds, it exists

  3. #3
    Join Date
    Jun 2003
    Posts
    61
    PHP Code:
    if(file_exists("NEXT_PAGE.php") {
        include(
    "NEXT_PAGE.php");


  4. #4
    Join Date
    Jun 2003
    Location
    Brisbane, Australia
    Posts
    53

    Thumbs up Thanks Mate!

    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??)

    PHP Code:
    if (is_file('./NEXT_PAGE.php')) {
    include 
    './NEXT_PAGE.php';

    Thank for your help, it is appreciated mate!!

    Jono

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles