kev Posted April 29, 2012 Share Posted April 29, 2012 Hello all. <?php $file_name = ("file_type.php"); if (file_exists($file_name)) { echo ("$file_name does exist."); } else { echo ("$file_name does not exist."); } ?> According to the source for this file the echo should have been: file_type.php does exist. Unfortunately the oposite happened: file_type.php does not exist. kev.... Quote Link to comment https://forums.phpfreaks.com/topic/261801-if_exists/ Share on other sites More sharing options...
scootstah Posted April 29, 2012 Share Posted April 29, 2012 Is "file_type.php" in the same directory as the script running this code? Quote Link to comment https://forums.phpfreaks.com/topic/261801-if_exists/#findComment-1341528 Share on other sites More sharing options...
kev Posted April 29, 2012 Author Share Posted April 29, 2012 Hello scootsah. The script is a piece of standalone script from a book turorial. I half guessed that the full path or something was missing but I wondered also if there had been some PHP change somewhere. By all accounts the book I have is a litany of minor errors most of which were waiting for me. The next example in line has the same problem but dealing with 'is_readable', 'is_writeable' and 'is_excecutable'. I will take it as a standalone script nothing will work as it is meant to. Thanks scootsah. kev Quote Link to comment https://forums.phpfreaks.com/topic/261801-if_exists/#findComment-1341534 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.