Okay, I'm very new to web programming. I'm creating my own database-driven website. I'm attempting to setup an admin login to update the site's content. I'm worried about acessing my mySQL databse securely however.
I intend to have the database search for the given username, and then compare the password hash to the hash of the given password.
My worry is in setting up the connection to the mySQL datbase.
from what I see, the way to do this is via:
<?php
$myConn=mysqli_connect(host,user,pass,dbName);
>
Now I intend to pass this to javascript to check all the credentials but if this is defined in the HTML file, then the login details would be plain for all to see yes?
Or, should I define it in an external .js file that will to the checking? I'm still worried if that is safe enough?