What is PHP?
PHP stands for "PHP: HyperText Preprocessor". PHP is a server side scripting language for making
logic driven websites. Ever wonder how they made that "contact us" form on their site, which sends
out emails? Well, they used PHP. Or, how they made that image upload tool? Well, they used PHP.
PHP written scripts can use databases to keep track of your customer's and visitors activities on your
site, send out periodical newsletters to your subscribers, upload files or images and drive the content
on your site dynamically. The possibilities are endless. Most of the social networking websites you visit
are writing in PHP. Yep! PHP is that powerful. Learning The Basics of PHP will help you tremendously in
your Webpage development.
How PHP Works?
Learn PHP and MySQL fast!
Learn how you can start building rich interactive
database driven sites like a professional developer easily
and quickly...
>> Order your copy now for just $39.95 <<
PHP sits between your browser and the web server. When you type in the URL of a PHP website in
your browser, your browser sends out a request to the web server. The web server then calls the PHP
script on that page. The PHP module executes the script, which then sends out the result in the form
of HTML back to your browser, which you see on the screen. Here is a basic php diagram which
illustrate the process.
PHP Process Diagram
What are PHP benefits?
PHP is a free open source language. That means you don't have to pay thousands of dollars in
licensing fee to acquire PHP. Best of all, it is easy to install. The most striking feature of it is that it is
easy to learn. PHP is used by millions of people and developers around the world. There are thousands
of websites on the internet which are written using PHP. One primary example is Yahoo! Bookmarks.
PHP has an ever growing community. There are thousands of websites, forums and community
websites dedicated on PHP. I built this site to share my PHP examples, recourses and code with you
that you can use on your website easily. I will also show you how to build your own PHP website with
all the bells and whistles from ground up. You will also learn the fundamentals of PHP and write your
own PHP code. Basic PHP at the ground level up.
What I need in order to build PHP driven sites?
You need PHP Hosting. One of The Best Is HostGator
Link Direct to Order Page . Good news is, Hostgator is one of the best and most affordable php and
mysql host on the web anywhere. There are tons of web hosting companies trying to compete for your
business but most do not live up to what they should.
I recommend Hostgator Looking for Web Hosting With Quality Support? 24/7 Support Via Phone, Live Chat,
and Email! The Live Chat Has Helped me many times and they stay with you until you are completely
taken care of.
Summary-Do you want to know if PHP is easy to learn? It is very easy to learn especially when you
take it a step at a time. Complicated things you may want to do on your website are made easier with
the usage of PHP and it will allow you to do almost anything you can imagine. Implementing simple
forms or logic on your site is very easy. Techniques of learning PHP is best shown with examples
Several Benefits of using PHP are: PHP is one of the Best Open Source Languages that is completely
free. You don't have to pay huge amounts of dollars in different licensing fees to utilize PHP. The most
exceptional feature of it, is that it is easy to learn and best of all, it is very easy to install. . PHP is
vastly used by millions of people and many developers around the earth. There are milllions of
websites on the world wide web which are written using PHP. This even includes sites such as Yahoo!
Bookmarks. What can PHP personally do for you? It can greatly increase the functionality of your
websites. It will allow you to write scripts which will allow your visitors to interact with you through
your website. If you are the owner of a small business website, you can use PHP to let your users
send feed back to you in relation to your ad services, products, or even create forms which will allow
your website visitors to send you emails Learn PHP you will find out what you have been missing in
your webdesign and development.
Setting Up PHP/MySQL on your Computer
You can easily install PHP and MySQL on your home computer easily (see PHP installation page). This
will allow you to write and test code on your computer and later deploy it to your PHP web hosting
account.
Is PHP easy to learn?
If you have the will and the determination, then nothing is hard. Just Follow the tutorials on my page.
I will walk to you through step by step, provide you with working examples, code and tutorails to help
you learn PHP. My goal is to make the learning process fun and easy for you:). If you have any
question or need help, you can email me.
From HTML to PHP
programming...
Learn how to build
websites in PHP
Installing PHP on Windows
Learn PHP and MySQL fast!
Learn how you can start building rich interactive database driven sites like a
professional developer easily and quickly...
>> Order your copy now for just $39.95 <<
Installing PHP is easy. You can install PHP on your computer easily with WAMP5. WAMP5 is
an open source application which comes with with PHP5, Apache web server, MySQL database
and phpMyAdmin (mysql database administration program). You can install these items on your
windows machine using WAMP5. You can read more about WAMP5 at www.wampserver.com.
Installing WAMP5
1. Download the latest version of WAMP5.
2. Run the installation wizard and follow the easy instructions to install WAMP5.
3. Once you're done installing WAMP5, please go to your folder where you installed wamp5. If you
didn’t specify which folder to install wamp during the installation wizard, then it should be
installed in your C:/ drive, i.e. C:/wamp.
4. In your wamp directory you should see the following folders.
a. apache2 – This is where the apache web server is installed. Apache will run our php
code and scripts on the web browser. You will not need to do anything in this folder. So
you can relax and ignore it for now:)
b. mysql – This is where MySql databse is installed. MySQL is an open source database.
PHP and MySQL work really well together. You can use PHP and MySql to store data.
Don’t worry, we will learn how to do all that in our tutorials.
c. php – You guessed it. This is where php modules are stored.
d. www – This is the root folder of our web server. This is where you are going to put all
your php files and scripts.
e. wampserver.exe – This file will run the WAMP program. We need to start WAMP
everytime we want to work with PHP. So, go ahead and double click on this file.
5. Once you run the wamp server file, you will see a small icon on your windows tray.
Right click on this icon and then click on “Start All Services”. This will start the apache web server
along with everything we need to run PHP pages on our machine.
That it! You’re almost done.
6. Now open up your web browser and type in http://localhost. You should see the WAMP welcome
page.
When you type in http://localhost in your browser, it executes the index.php file in your www
folder. All our php files will go in the www folder. Follow the next tutorials to see how that is
done.
There you have it! You’re now ready to begin your adventures in the PHP world. I know you
must be excited. I know I’m :D
PHP Tags
Learn PHP and MySQL fast!
Learn how you can start building rich interactive database driven sites like a
professional developer easily and quickly...
>> Order your copy now for just $39.95 <<
PHP is a web scripting language which means it was desgined to work with HTML. You can
easily embed PHP code into your HTMl code. Hmmm! Nice but how do we do that? Simple.
When writting php code, you enclose your PHP code in special php tags. This tells the browser
that we're working with PHP. See below.
<?php
//your php code goes here
?>
PHP and HTML
Now let see how we blend PHP and HTML together.
<html>
<title>my php page</title>
<body>
<?php
echo "hello there!";
?>
</body>
</html>
Echo is a special statement in php for outputing data to the browser. This statement is more often
used when we need to print something to the browser. You will learn how to use echo in as we
go along.
Note: Note that, at the end of each PHP statement we need need to put a semicolon, i.e. ";" as you see
in the above code. Otherwise PHP will report syntax error.
Pretty neat, eh? I remember when i first wrote my php code, i was just so amazed :)
So, let do that. Lets write our first PHP page.
My First PHP Page
1. Open up notepad.
2. Copy paste the above PHP and HTML code in notepad.
3. Now, lets save the file in our www folder, i.e. c:/wamp/www
Remember, we need PHP to run PHP pages on our computer. To install PHP, please go to the PHP
installation page.
4. Name the file my_php_page.php and save it in your www folder.
All PHP files must be saved with extension .php. This is important because we need to tell the
browser that we are working with PHP.
5. Now, go to http://localhost/my_php_page.php in your web browser.
You should see "hello there!" printed out on the browser. Pretty simple, eh?
There you have it. You first web page in PHP. Now, let’s play around with the code. Let’s do
some more cool stuff.
Doing Cool Stuff with PHP and HTML
Echo statement is powerful in a sence that you can put HTML code in it and it will render the
text as if it was HTML in your browser. Try it!
Example - Make Text Bold
Replace the PHP line in your code to the following code. Save the file and now refresh your
page.
<?php
echo "<b>hello there!</b>";
?>>
You should see hello there! in bold letters in your browser.
Example - Make Text Green
Replace the PHP line in your code to the following code. Save the file and now refresh your
page.
<?php
echo "<font color='green'>hello there!</font>";
?>>
You should see hello there! in green in your browser.
Example - What's today's date?
Lets print out today's date using the php date function. Don't worry we will see more examples of
the date function in later tutorials. We will learn some useful techniques for printing date in
different formats. For now, let's try the following code.
<?php
echo "today is ".date('Y-m-d');
?>
Try it! Replace previous echo line with this line. You should see today's date, "today is 2011-03-
08", printed out on your browser.
So, in this section we saw how we can add PHP into our HTML code. This should give you a
brief glimpse into how PHP works and what we can do with it. You're now ready to move on to
some advance PHP stuff! What are we waiting for, let’s go!
Web Hosting Reviews
Thousands of web hosting USER reviews. Don't sign-up with any web host before checking out
the web's biggest web hosting reviews site first, available at WebHostingReviews.com.