Hashing Database credentials in PHP Code


I’ve been working on a website that uses SQL authentication to connect to a database. However because of the code that I’m using, the password and username are available for people to use if they intercept the connection between the 2 servers.

Is there a way to ‘hide’ or hash the password and username so that it can still connect and not be seen?

The connection code is below:
$connection = odbc_connect(“Driver={SQL Server Native Client};Server=ServerIP;Database=DBName;”, ‘UiD’, ‘Pwd’);

Everything in red is what I changed for the sake of posting on here

Any help would be appreciated!

Sponsor our Newsletter | Privacy Policy | Terms of Service