practical way to test php

Trying to connect to mysql database provided by web host. I learned about making a script that assigns credentials to variables and putting that script in the protected folder, then Including that script in another. Since it is protected, the only way to include it is from a script running on the server. So I make the script locally, ftp it to the server, view it in my browser, see that it doesn’t work, make a change, ftp it again, view it again… but wait, am I viewing the changed file or is the old one in my browser’s cache? Do I have to clear the cache and restart the browser? Is there a more efficient way of testing things that will only work on the server?

If I’m understanding you correctly, you should be able to run on a local server any php file that is able to run on a remote server. Local servers have security credentials to local MySQL databases as well, usually it localhost for the host, root for the username and whatever password you supplied it when setting up the local server. If you need help setting up a local server (XAMPP or others) or other types of servers (JimL can explain better) then feel free to ask for help. Right now it seems that you’re just banging your head against the wall and going around in circles.

Sponsor our Newsletter | Privacy Policy | Terms of Service