XAMPP: Tips for Running an Apache/MySQL Server in Windows XP - Useful XAMPP Techniques
(Page 3 of 4 )
After learning a bit about XAMPP, its security and features, we will proceed to illustrate some XAMPP techniques. Okay, let’s start with the basics:
Executing your first PHP script
Say that you have a script named “basic.php,” which is a PHP program. Executing the script in your local Apache server is made possible by saving your PHP/html source in the htdocs folder. If you have installed XAMPP in drive C, htdocs can be located in C:XAMPPhtdocs.
The files inside htdocs are the “local” or “offline” equivalent of the online web hosting root web server space. The root is the most important section of the web space because it is the reference for all folders. If you have website whose URL is http://www.yourwebsite.com/ , the forward slash “/” signifies the root directory. If you upload a file to the root directory via FTP, for example “thisisyourphpscript.php,” it can then be executed in your browser address bar as http://www.yourwebsite.com/thisisyourphpscript.php .
The offline equivalent of the above web address is this: http://localhost/thisisyourscript.php , provided you have saved the script in this Windows-based path: C:XAMPPhtdocsthisisyourphpscript.php
Creating a database and tables using PhpMyAdmin
This is why I love XAMPP; the PhpMyAdmin is bundled with PHP, and database creation is straightforward. To directly access the database, type this in the address bar: http://localhost/phpmyadmin and be prepared to input security details such as the username and password.
A tutorial on database creation and its details is beyond the scope of this article, but always bear in mind that database communication to PHP scripts is basically the same as what you would do when you upload your scripts online (of course you will need another MySQL username, password, hostname, etc.).
Next: Testing scripts in PHP 4 and PHP 5 >>
More BrainDump Articles
More By Codex-M