PHP – Hello, Snitches!
Following in the Open Source spirit. We’re going to go with a PHP script. Demonstrating a simple way to write a message using PHP server-side technologies. Now if you don’t know what exactly PHP is don’t worry, everything will and can be explained. PHP is on the Open Source side of things; meaning anyone can learn and use it. When we say it’s a “Server-Side Language”: it means that all the information is processed on the server’s side and the client doesn’t see anything until the server decides what they should and shouldn’t see. So yea…. think of of the person visiting your page is a child and you are its parent. You ge to paint their world and how they see it! YAAAYYYY! PHP!!! And best of all its free!! If you feel like you still need some clarity just google/wikipedia PHP. So yesss… lets go basic with the PHP for now… PHP files have the extension .php (much like html has .html.) With that said, go to any text editor and create a new text file. Rename the extension from .txt to .php. After this open your newly created .php file and lets start writing some code in it!
PHP files start like this:
1 | <?php |
And end like this:
1 | ?> |
Now in between these two is where your code is going to go. So it should look something like this:
1 2 3 4 5 | <?php ————->code<————— ?> |
Pretty simple right?! Lets not just write the word code and lets actually put something that is dynamic to the page. Being that PHP is a language it has an abundance of words and functions that you can use and combine to your liking. For now lets go with the most basic of all which is “echo.” This function will give whatever value you’d like to the user. Think of it as you needing to speak with a friend, lets give him the name “John Lennon.” Now John is not exactly in direct contact with you and is extremely difficult to find and speak to. Now your only solution is to find another friend (who we will name “Jimmy Hendrix”) that is in constant communication with John. Now since you’re sure that Jimmy is always speaking to John all you have to do is give Jimmy the message and he’ll pass it along to John. That’s exactly what the function “echo” does in your code. It takes any value that you give and it displays it to the visitor. Lets put it into PHP code.
Again your first line will always be the following:
1 | <?php |
Next your going to use the function of “echo”:
1 | echo="Hello, Snitches!"; |
Now, notice that I put the phrase inside quotation marks. This is always neccessary when you’re dealing with straight text. Also, very important! Notice at the end of the phrase there’s a semi- colon “;” this is used to imply that our code has ended for this line. Every line of PHP code should have a “;” . And when you’re done inserting code go ahead and use the closing tag for your PHP file.
1 | ?> |
After this you should have the following:
1 2 3 4 5 | <?php echo="Hello, Snitches!"; ?> |
Go ahead and upload your file to your web server to see your work. Now if you want you can keep going crazy by adding more “echo” functions and see if you can display your entire page using this function alone. When you do try visiting the PHP main web site for more funstions and tutorials! Or just google PHP Tutorials.

