Creating And Running A PHP Page
Filed under » Programming » Creating And Running A PHP Page
![]() |
PHP like any language can be simple and complex. The beauty of PHP is in its power to liven up static websites and convert these with dynamic real-time data updates. PHP (like ASP) is so versatile that you can intertwine PHP code with HTML markup.
A very very basic example of this is showing date within your page. Notice the code below: What the above sample does is it simply outputs the date in this format 'YYYYMMDD'. Neat huh? When trying this, you must remember that you have to setup a WAMP (Windows Apache MySQL PHP) server if you are running on windows or a LAMP (Linux Apache MySQL PHP) server.
You can download a no-frills installer with Apache Friends. Just download it and run the installer.
To start with PHP, you have to look for the folder 'htdocs' in the XAMPP folder the installer created. Once you reach this folder, just create a new folder and save all your files as 'filename.php' and you are ready to go.
Open your browser and on the address bar type 'http://localhost/yourfolder' to access the mini-site you just created.
There are dozens of sites on the internet where you can find tutorials. You just have to know what it is you want to do.
Updated by Alphonse Tan on May 25, 2009 20:25