dark_hatchling Posted February 26, 2009 Share Posted February 26, 2009 I'm really new to PHP/MySQL but I got an offer from a friend to set up a site and its going to need some databases... short story made shorter, I was wondering when we actually go to launch the site to the web how exactly our log in code should be written for the database connect " $connection = mysql_connect("localhost", "root", "root"); if (!$connection) ..yadda yadda " i mean we wouldnt want to directly place our log in names and password in the html source for everyone to see, right? so I'm wondering how we go about this, making it more secure and everything. any ideas or solutions are appreciated, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/147001-question-about-mysql-log-in-on-the-web/ Share on other sites More sharing options...
Mchl Posted February 26, 2009 Share Posted February 26, 2009 This code is not visible for the end user. All PHP is processed on the server, and only the final output is being send to browser. You can get additional level of security, using include to include the database credentials from a file, that is above document root (i.e. is not accessible from web at all). Quote Link to comment https://forums.phpfreaks.com/topic/147001-question-about-mysql-log-in-on-the-web/#findComment-771732 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.