Weiss Posted August 25, 2017 Share Posted August 25, 2017 Hello, A noob in a need of help here! my question is about using sql with php, right now im doing it on localhost so its no problem,BUT, when i move my site to be a real site, the php file has a line that connect to the sql database using the database name, my username and password. so my question here is- isnt it dangerous to have a php file on the server like this? i mean, cant someone save the php file and look into it and see the password? thanks in advance Link to comment Share on other sites More sharing options...
justsomeguy Posted August 25, 2017 Share Posted August 25, 2017 They can only read your code if they have FTP or shell access to the server. Otherwise, they see the same thing that you see when you open the PHP file in your browser. 1 Link to comment Share on other sites More sharing options...
dsonesuk Posted August 25, 2017 Share Posted August 25, 2017 Unless you actually echo out the username, password you won't see these. 1 Link to comment Share on other sites More sharing options...
Weiss Posted August 25, 2017 Author Share Posted August 25, 2017 Ah so the php file is safe within the hosting server! thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now