marcus Posted November 2, 2006 Share Posted November 2, 2006 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 More sharing options...
gluck Posted November 3, 2006 Share Posted November 3, 2006 print the page path and see what it has Link to comment https://forums.phpfreaks.com/topic/25993-file_exists-problem-help-needed/#findComment-118810 Share on other sites More sharing options...
marcus Posted November 3, 2006 Author Share Posted November 3, 2006 It says...Why would I need to print it?I mean it's finding it inc/$page.inc Link to comment https://forums.phpfreaks.com/topic/25993-file_exists-problem-help-needed/#findComment-118837 Share on other sites More sharing options...
trq Posted November 3, 2006 Share Posted November 3, 2006 So you have a page called inc/$page.inc then? Link to comment https://forums.phpfreaks.com/topic/25993-file_exists-problem-help-needed/#findComment-118846 Share on other sites More sharing options...
JasonLewis Posted November 3, 2006 Share Posted November 3, 2006 how are you typing it in the address bar? Link to comment https://forums.phpfreaks.com/topic/25993-file_exists-problem-help-needed/#findComment-118968 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.