Hosts add your services here
Hosting Reviews
Hosting Types

Hosting Tutorials - Read hosting related tutorials written by the hosts themselves

What is PHP?
PHP (Pre Hypertext Processor) is a script that you write and place on a server running Apache or Litespeed
that when requested will produce a HTML page that can be sent back to the viewer. This script can then make
the page that is being viewed on-the-fly so it can be tailor made for the specific person viewing it. It can
also take variable sent from the user, such as login details, details about them or anything else you can
think of which it can take into account when producing the page. Another fantastic feature is that it can
connect to a database (usually MYSQL) and store and retrieve mass amounts of data organised correctly.

What do I need to run PHP?
You need to have a server running Apache or Litespeed so that it can process the pages properly. You also
need a way of writing the scripts, you can use a commercial editor such as Dreamweaver that can help colour
code parts of the script to help you distinguish between different keywords. You can also just use the bog
standard Notepad that comes with Windows. Either way the file must be save as 'thefile.php' so that the server
knows that it is a PHP file.

What does a basic PHP script look like?
The most basic script would be the Hello World script, this script displays the words hello world to the
viewer. It looks like: "space placed between seach character to stop server processing what is written"


// "Two slashes in this direction mean that the rest of the line is a comment

< ? php // This tells the server to expect PHP code

echo 'Hello World'; //This tells the server to print to the screen Hello World

? > // This means that the PHP has finished


Thats it! You save that as helloworld.php and upload to your server, then you go to it in a web browser and
the server will process it and send back HTML. The HTML will simple be Hello World but it has processed it
from the script.

Where do I go next to learn more about PHP?
A simple search in Google will find you tons of free places to get tutorials on PHP. The official PHP
website is a godsend for when you need to quickly find how to do something or how to write it properly
(php.net).

I hope this tutorial helps you get started in PHP, it is a fantastic language to use and is hugely versatile

This Article was submitted by HostingBest.co.uk - If you found it useful, please consider them as your host


Alert: