Before you read on, note that this is not an actual PHP tutorial, but more of a "useful for PHP coding" tutorial.
I see a lot of people coding their site by saving the PHP page on their computer, then uploading it to their web space, and only then testing the page. This is a huge waste of time, and it requires people to either shut down their site, or make it all in a folder that if found will destroy all the project's secrecy. It also sometimes adds errors to pages while they're actually being used by other people.
If you are in this situation, and you're thinking that there must be an easier way to work on your site, rest assured! I've been developing my site for a while now, and I could never imagine going back to horribly slow save n upload.
This guide will teach you how to develop your website, just like if you were developing it online, except you'll be doing all that locally! Heck, you can even work on your website when you have lost Internet access! Using this technique, you can develop an entire system, and only once you're finished, upload it, and launch it in minutes! All you need to do is run a server on your computer, and there are a lot of tools that make this easier.
First, you should get easyPHP. It's the easiest way to get you started with an offline server. Once you've installed it, you need to go to Start>All Programs>EasyPHP>EasyPHP. Normally, the servers (both MySQL and Apache) will start automatically. If they don't, start Apache, then start MySQL. Once both servers are online, just minimize easyPHP, and go to http://localhost/ using any web browser. Ta-da! You should see the default easyPHP page. The files are in Program Files/EasyPHP1-8/www/
NOTE: The default mySQL username on easyPHP is 'root' and the password is just blank. Nothing. You can access phpMyAdmin by going on http://localhost/mysql/
Now, you might have some problems with the fact that you'll have to access your site with this ugly localhost address. This is the trick I'm most proud of, and it WILL be useful! What we want to do is assign a bogus domain to your localhost. For example, my domain name is www.locklegion.com, we want the domain www.locklegion.loc (.loc stands for local) to go directly to your PC. Don't worry, you don't have to purchase any other domain name! All operating systems have a great thing called a HOSTS file. It's a file that determines different IPs for certain domain names.
The HOSTS file, in Windows, is located in C:/Windows/system32/drivers/etc/HOSTS. Yes, the file is just called HOSTS, there is no extension to it. Open that file using Notepad. You'll see localhost is actually already "fake" domain name itself. All you have to do now to make your fake domain name to work, is add the two following lines at the end (replace yourdomain by your actual domain. For me it would be locklegion, for NG it'd be newgrounds, etc)
127.0.0.1 yourdomain.loc
127.0.0.1 www.yourdomain.loc
You have to add both www-prefixed and non-prefixed domains because HOSTS files don't support wildcards (it would be way too easy for malware to redirect any site to their own).
There you go! You can now access the local version of your site by going on www.yourdomain.loc!
NOTE: You and only on YOUR COMPUTER will be able to access the .loc domain name, don't think that it will magically create you a domain for free!
TIP: When you're developing your site, or upgrading things, I suggest you use an editor that can have multiple files open. Once you edit a file, keep it open, and keep all the files you edited open until you're done. Then you won't even have to remember which pages you edited, seeing as you have a list of all the opened files in your editor. This works well with people like me that have a bad memory.
I hope you enjoyed this tutorial, and I hope you'll be able to develop your site much faster, and more securely than before!