Free Web Tutorials Free Online Tutorials About Us Contact Us

Introduction To Php Tutorial:



Lets create our first script, this script will output hello world, at least then we no php is running and working on IIS.(Alternatively you can just upload your php script to your web server and test it.

<?php
	print("hello world!");
?>

As you can see this actually just one line of code. Print allows us to output text enclosed in brackets/inverted commas, all lines also have to end with a semi colon, otherwise an error will be reported.


Why not try this.

Rememember Open your PHP tags <?php and close them with ?> .
Save your file as helloworld.php and upload it to your web server. Now, using your browser, go the the URL of the script.
If it has worked (and if PHP is installed on your server) you should see the output hello world.

Locally you should be able to test it with http://localhost/helloworld.php, you will have copied the file to c:/inetpub/wwwroot (and if PHP is installed on your server).

You can also output text using echo - I personally use echo but this is up to you. You can append variables etc to the echo and print output (See next lesson)

<?php
	echo "hello world";
?>

free online unix tutorial