I am supposed to store the database username and password in a .inc file outside of my html folder. my question is, how do you declare variables in .inc and how can i refer to the includes folder outside of my html folder?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can define them with constants:
and use them with an include in your html-folder
Please make sure the database.inc is really out of the document-root of your apache, otherwise the database password can be opened as plain/text. Consider using the *.php extension to your database.inc (=> database.php).