pcw Posted March 10, 2009 Share Posted March 10, 2009 Hi, I was using file_exists in part of an installation script. It was working but now it isnt. This is what I have got: <?php print"<table border=0>"; print"<tr><td bgcolor=#CCCCFF>"; print "<center><b>File testing</b></center></br>"; print "<b>Checking files exist:</b>\n<br>"; if ( file_exists("adminpw.txt") ) if ( file_exists("enter.php") ) if ( file_exists("login.php") ) if ( file_exists("license.txt") ) { print "Check passed: All files are present\n<br>"; } else { print "Check Failed: Please reinstall and check all files are present\n<br>"; } etc. ?> Can anyone tell me what is going wrong? Also is there a way I can use file_exists to check multiple files instead of typing file_exists for every file I need to check? Link to comment https://forums.phpfreaks.com/topic/148796-solved-file_exists-help/ Share on other sites More sharing options...
lonewolf217 Posted March 10, 2009 Share Posted March 10, 2009 you aren't using the IF statement correctly. <?php if ( file_exists("adminpw.txt") & file_exists("enter.php") & file_exists("login.php") & file_exists("license.txt") ) { print "Check passed: All files are present\n<br>"; } else { print "Check Failed: Please reinstall and check all files are present\n<br>"; } Link to comment https://forums.phpfreaks.com/topic/148796-solved-file_exists-help/#findComment-781316 Share on other sites More sharing options...
pcw Posted March 10, 2009 Author Share Posted March 10, 2009 Hi lonewolf217, Many thanks, that was just what I was looking for. Link to comment https://forums.phpfreaks.com/topic/148796-solved-file_exists-help/#findComment-781338 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.