Jump to content

file_exists(); problem [help needed]


marcus

Recommended Posts

Ok, what I'm trying to do is, if the file does not exist it will echo off like This file does not exist, or whatever.

Here is my code:

[code]
<?php
 
        $page = $_GET[page];
  $ref1  = $_GET[ref];
  $ref  = $_SERVER[REQUEST_URI];

include('refs.php');
 
  if($page == false){
  //$number = "7";
  include('news/show_news.php');
  }else
//if(!file_exists($page)){
//echo "This page does not exist, sorry :(";
//}else
  if($page == $page){
  include("inc/$page.inc");
  };


    ?>
[/code]

But each time I use that, I go to a page does exist it says it doesn't (when uncommented). How can I fix this?
Link to comment
https://forums.phpfreaks.com/topic/25993-file_exists-problem-help-needed/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.