Originally posted by andy753421
...it doesnt seem very secure because other people have access to the same site in order to post messages and I'm afraid someone will be able to post a message and they could just have the message contain a php script to get the password from the password_file.php and the use it to do whatever they want.
Keep any include files or other sensitive data/files off the public web directory (and place in the root or sub-directory off the root).
You need to validate all input coming to you through forms. As already stated, PHP won't execute any code unless eval() is used. To be safe, you can use strip_tags() to remove HTML and PHP from the input.
md5() is a form of one way encryption. Maybe you should think about using two way encryption using mcrypt/libmcrypt since you want to be able to get at the original password.
To encrypt with that library requires that you generate a key. Again, open to a bit of risk if someone gets a hold of the key (they can decrypt the password, etc.).
You can also make your script(s) not readable/protected. You can achieve that with products such as http://www.codelock.co.nz. There are others of course, but this one has the best feature to price ratio.
hth.