PHP part 1

Well, I could dive right into the here’s what you do and whamo blamo you have a web site but I believe it is important to understand the basics before you start.

So here it is:

What is PHP.. Well, to put it simply, it is a scripting language. Therefore, you create this text file ending with the extension PHP and when someone accesses the file the web server sends the file to the PHP engine to act on the magic stuff you put in there. Simple enough?

Your script will look something like this:

<?PHP

print "Hello and excuse me but I believe your pants are on fire"; //this is one way to use the print function
/* Sorry but I hate the "Hello World" "standard" */

?>

As you can see above I opened with the “PHP” tags so the php engine will know to act on whatever is between the opening and closing tags. I told the engine to print Hello and excuse me but I believe your pants are on fire. Then below I put a comment.

One line comments can start with // and multiple line comments should be enclosed with /* comments here */

PHP print function

Leave a Reply

Your email address will not be published. Required fields are marked *