What Is PHP?
PHP stands for Hypertext PreProcessor. It is a server-side scripting language. The PHP code can be mixed in with regular HTML tags and parsed on the server.
What Can PHP do?
PHP can do many things, such as creating a hit counter, login script, guestbooks, form handling, as well as really complex things like Content Management Systems(CMS), Social Networks, etc… The possibilities really are only limited by your imagination, and knowledge.
What Do I Need To Get Started?
PHP requires only a server with PHP installed and a simple ASCII text editor such as Notepad(standard on all Windows machines).
You can rent server space and purchase a domain name from numerous sources on the internet. A decent hosting provider, and one i use myself is http://www.godaddy.com, it is also one of the more famous ones.
Alternately, you can install server software, and PhP on your computer to practice with. XAMPP, and WAMP are just a few examples of such software. With these packages, and even a manual install of Apache you can go as far as running your own live website, right from your PC.
Your First Script
[code]
<?php
echo 'Hello World!';
?>
[/code]
When ran, the above script will output the following to your browser window:
[code]
Hello World!
[/code]
Taking A Step Further
Try this:
[code]
<html>
<head>
<title>Hello World</title>
</head>
<body>
<?php
echo 'Hello World!';
?>
</body>
</html>[/code]
The above code, will still output “Hello World!” to your browser, but inside the actual html code, as if you were to just type out Hello World in <p> tags.
Summing It Up
That concludes part 1 of my beginners guide. I hope you found it useful.
Filed under: PhP, PhP Tutorials |