Not Just Paranoid

Another site by Pete Maynard

PHP #1

To start with PHP you need to have a web server that supports PHP. You can either use a free web host, or run your own server. If you want to run your own web server on windows just download XAMPP. Once you have that downloaded and installed, all you do is save your PHP scripts in the htdocs folder (Same for all web servers) then navigate (in a web browser) to http://localhost/. Or if you are using a free web host such as http://awardspace.com just upload the php scripts to the root directory (htdocs)

To write a PHP script you just open up a text editor (e.g Notepad, gedit etc) and write in the PHP script and save as filename**.php** make sure that it ends in dot php.

Now to make sure that the server knows that it is a PHP script you musty have <?php at the beginning and ?> at the end.

So we will start with a basic Hello world! example. Write don’t copy this into your hello.php file:

<?php
	echo "Hello World!";
?>

To find out information about your PHP server, such as what modules it has and which version, Man Page :

<?php
	phpinfo();
?>

There you go a very simple PHP scrip.

Hope this helped, Pete Out

11 Dec 2007 | Tags ( PHP tutorial )

Website Last Updated on 4 Oct 2024 (CC BY-SA 4.0)

This site uses JQuery and nanogallery2 hosted by jsdelivr.net
for the Flickr photo feed and GoatCounter for user insights.