Thursday, June 17, 2010

On your Mark...Get Set ...Ready..Go .. Your First PHP Program

Now its time to code and run your first PHP program. We have learned how to install XAMPP on your environment in the previous articles. Follow the steps given below to run your First PHP script. Before that make sure that the apache and mysql services are running by typing http://localhost/phpmyadmin (or) http://localhost/xampp. If its not working then start the Apache and MySql services using xampp-control.exe. After that Follow these steps.

1. Open the Notepad and type the Following Code
   
<?php echo "

Hi ! Welcome to the World Of PHP ! I am your first PHP Script ! Cheers !!!

";  
   ?> 

2. Save it as "welcome.php" and select the save as file type as "All Files". You have to save inside your htdocs folder of XAMPP since it is your root directory. 
  Eg : C:\xampp\htdocs\welcome.php         


3. Now open your web browser and type the URL http://localhost/welcome.php to watch how your First PHP script runs.

    Cheers ! Now I hope you feel that you're at the top of the world !!!


Enhanced by Zemanta