Log in

View Full Version : if file is located



insanemonkey
11-29-2007, 09:09 PM
hi everyone, I am not sure how to do this, but here i go...

ok I am making a project and I want to have a copyright in it so it cant be removed...

and my idea is to add a if statement saying/idea like this..

if(file.php ==0){
echo
} else {
echo error
}

trying to use a if statement to locate and see if a file is there.. and if it isnt then show a error and the page cant be displayed, I hope you get it..
is there another way to show this?

boogyman
11-29-2007, 09:17 PM
can you explain yourself some more?

php occurs on the server-side, so what you could do is check if the file is on the server, but unless you or someone else that has access to your server, the file will always be there. the way to check if a file is present / readable on a server is



file_exists(file)
is_readable(file)

both of those will return the boolean value true/false respectively

insanemonkey
11-29-2007, 09:30 PM
well the project i am making is going to be distributed... soon,maybe.. and I want a copyright.. Its for the copyright I want to check if file is there then echo the file...

thankyou this helps...