PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I wanted to check if a file exist in a directory and if it doent exist the flie should be created and if it does exist the user should be told to change the name of the file he or she intends to create in the directory.
I tried the below script but if the file doesn't exist, i receive this error; Warning: file(ient.php) [function.file]: failed to open stream: No such file or directory in E:\Webserver\xampplite\htdocs\text\index.php on line 3
So I need help on this script so I dont receive the error.
Your problem is that your testing to see if a variable is populated or not in the if statement, but the statement isn't checking to see if the file exists. Your solution is to first test to see of the file exists. You may want to search around the manual and see of there is a function that can test to see if a file exists or not. That would solve your problem.