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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.