PHP concept

Hi everyone

I’m currently learning php. Is it true that if you create a php (i.e. for login, password purposes) the file cannot be downloaded by anyone?

My point is, is it safe to write the login and password details in a php file?

Thanks in advances,
Mike