Jump to content

question about MySQL log in on the web


dark_hatchling

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/147001-question-about-mysql-log-in-on-the-web/
Share on other sites

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).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.