Using the webserver
When we installed the Apache server, a directory called htdocs was created. This directory with the unusual name is the gate to our webserver - everything within it is also available through the HTTP protocol and thereby a browser. Depending on how you installed Apache, the files in the htdocs folder can be accessed through http://localhost/ or http://localhost:8080/ (remember to start Apache before testing these URL's). Files can be reached by appending the filename to the above address, and the same goes for folders, which can be accessed by appending the foldername to the address. A file within a set of subfolders can be reached like this: http://localhost/folder1/folder2/filename.php.
Within this tutorial, we save the files to the htdocs folder, and then access it through the browser with the localhost URL, to get the code interpreted by PHP and returned to the browser.
© php5-tutorial.com 2007-2012