I am a bit new to this.. but I have create a great little login script.. the only thing is I want to hide the info that connects to my database so im not easily hacked.. Example <?php $db_host = 'localhost'; $db_user = ''; $db_pwd = ''; $database = ''; $table = ''; I have this in the top of every file that links to the database.. how would I add in something that would link for example like css? and would also hide it? like one main file that holds the database info? thanks
You should move all database infos to a .php file, eg. config.php. In top of every file that links to the database, you add: require('config.php'); Code (markup): Â Â This will reduce security risk.Â
or you can use include : http://php.net/manual/en/function.include.php http://www.w3schools.com/php/php_includes.asp