The Basics

Creator:
Tripper
Description:
This Tutorial will try teach you the basics of PHP.

Firstly, before we begin a brief description of PHP, You may have heard of it or you may not have.

PHP is a powerful scripting language, unlike Javascript PHP is processed server side, so what you see is what left the computer hosting it, Because of this some hosts may not have the ablitly to host PHP files. For this Tutorial, some PHP host or access is reccomended,

Ripway should be fine. Now just with any language, we need Tags, to put our PHP content between, with PHP the opening tag is <? or <?PHP while the closing tag is ?>, Anything between that tag must have correct PHP syntax, but lets not worry about that for now.

If we want to display something, other than Hello World, we can use echo. Echo writes what you tell it to, If I wanted my page to say "Howdy Doody" I would use, echo 'Howdy Doody';

That line is correct syntax, so will print Howdy Doody. If I put echo Howdy Doody I would get errors, you must put ' around your work, so PHP nows you are wanting it to echo that. ; is important to, PHP will know no to goto the next line, and forget the previous.

If you want to test a file, try


<?php echo 'Howdy Doody'?>

Save that as test.php and upload it to your host.

Now you have learnt the basics of PHP, you can move on to other tutorials.

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <b> <u> <i> <hr> <img src <url=
  • Lines and paragraphs break automatically.

More information about formatting options