Jump to content

[SOLVED] new mysqli security?


robert.juric

Recommended Posts

I've just started learning php/mysql and I was wondering how you normally handle security when you connect to the database.

 

I've been using this statement at the beginning of my code:

 

$mysqli = new mysqli("localhost", "user", "pass", "dbname");

 

I've only had this running on my laptop for development, but if it were a real environment how would you secure that? I know it wasn't designed to have the password open in the source code so I must be missing something?

Link to comment
https://forums.phpfreaks.com/topic/78924-solved-new-mysqli-security/
Share on other sites

PHP code that is inside of <?php ?> tags in a file that is parsed by the php language engine is not visible when you browse to the file. You only get any output that is echoed/printed... by php. Unless you have an echo "the database password is pass"; in your php code, no one can see what it is through a browser.

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.