Searching...
Sunday 14 July 2013
7/14/2013 09:49:00 am

BEGINNING PHP :"hello world"

In my last post I taught you about how to install xampp and start  apache on your pc so you can run PHP scripts.

Let's head towards the first program of  PHP (and of all languages) - The "HELLO WORLD" program.

1. Start APACHE as told in last post .
 After APACHE turns green.
Open your preferred browser and in the URL bar type "localhost" .
(no need to type localhost/xampp  it will automatically redirected.)




 The screen will look like this -




If you get this screen then your XAMPP is working right and your Apache server is working fine










2.  Download the file from here helloworld.php

3. Open it in Notepad++, and save the opened file in  C:/xampp/htdocs/  directory (htdocs of your xampp folder {wherever you installed it } otherwise you will not be able to run them.)


or

Save the downloaded file in the htdocs folder itself.


(I installed it as xamppnew , similarly your xampp's htdocs folder)






The file you downloaded above has this / looks like this in Notepad++.(Read it (after downloading) once or twice to get familiar with PHP.)





4.Go to your browser and in URL bar type "localhost/helloworld.php" or (localhost/"name of the file you saved")

   5. Press Enter , voila ..... you just ran your first script of php.

    Output will look like this...

Have any problem comment below.

 Thank for viewing the post.
Now you can start you PHP learning for more knowledge.
Feedbacks,suggestions are welcome - either here or at saharsh100@yahoo.com



0 comments:

Post a Comment

 
Back to top!