PHP is a very easy language to learn and to use. In this simple tutorial I will show you how to create a PHP script that display's "Hello World".
Lets Start
1) First open notepad
2) Add this line to your the top:
This line lets the web server know that you are executing PHP and to execute this before displaying the HTML.Code:<?php
3) Next we will use the Echo function to display our text, Hello World. Alternativly you could use the Print function as well.
Add this below <?php:
4) To finish our script we need to tell the server that we have reached the end of our PHP execution code. Add this line:Code:echo "Hello World!";
5) Save your file as hello.php and upload it to your webserver. Goto your website url (http://www.yourwebsite.com) and add /hello.php (http://www.yourwebsite.com/hello.php and you should see:Code:?>
Hello World!
I've attached the sample file.
Void
Well nice work! I dont know alot of PHP so I will see and make all your tuts, if you post more! Im interested in learning more PHP!
There are also other methods of saying the same thing.
Yes, but why is it so big? Shouldn't it be smaller?
If you are refering to the BIG Hello Word, I dont think that he did that in php, he just did that as an ending of the tutorial!
a simple example for php dude...but nice...
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks