PHP

adplus-dvertising
Introduction Of PHP

PHP- Hypertext Preprocessor is server side script language like ASP. Its scripts executes on server. PHP is open source software. The goal of PHP language is to allow web developers to write dynamically generated pages quickly.

  1. PHP was released in 1995 by a programmer Rasmus Lerdorf and is now maintained by PHP Group.
  2. Its original full form was personal homepage tools.
  3. Zeev and Andi rewrote the parser for PHP to launch PHP3 with a full form "Hypertext Pre-processor".
  4. It can be used with different operating systems like Microsoft Windows, Linux, UNIX and Solaris.
  5. It can be linked to different database systems easily.

Download wamp server

History Of PHP

The origins of PHP date back to 1995.PHP was written in the C programming language by Rasmus Lerdorf in 1995 for use in monitoring his online resume and related personal information. For this reason, PHP originally stood for "Personal Home Page".

  1. Lerdorf combined PHP with his own Form Interpreter, releasing the combination publicly as PHP/FI (generally referred to as PHP 2.0) on June 8, 1995.
  2. Zeev Suraski and Andi Gutmans, rebuilt PHP's core, releasing the updated result as PHP/FI 2 in 1997.
  3. PHP 3 was released in 1998, , which was the first widely used version.
  4. PHP 4 was released in May 2000, with a new core, known as the Zend Engine 1.0. PHP 4 featured improved speed and reliability over PHP 3.
  5. PHP 5 was released in July 2004, with the updated Zend Engine 2.0.
  6. PHP 6 has been in development since October of 2006.
How PHP works?

Here i am giving example for form like-

<FORM ACTION="display.html" METHOD=POST> 
<INPUT TYPE="text" name="name"> 
<INPUT TYPE="text" name="age"> 
<INPUT TYPE="submit"> 
<FORM> 
the content can be like
<?php echo "Hi $ name, you are $ age years old!<p>" >

t's that simple! PHP automatically creates a variable for each form input field in your form. You can then use these variables in the ACTION URL file. The next step once you have figured out how to use variables is to start playing with some logical flow tags in your pages. For example, if you wanted to display different messages based on something the user inputs, you would use if/else logic.

<?php if($age>50);
   echo "Hi $name, you are ancient!<p>";
   elseif($age>30);
   echo "Hi $name, you are very old!<p>";
 else;
  echo "Hi $name.";
   endif;>

PHP provides a very powerful scripting language which will do much more than what the above simple example demonstrates. See the section on the PHP Script Language for more information.

Difference from Other language

PHP Vs ASP

ASP PHP
ASP is a Microsoft product based on the very awkward Visual Basic syntax.PHP is a C-Like, very compact and well organized
ASP requires the registration of components to do that and very ackward object declarations. Most of these components are not free PHP can be easily installed with a very large number of tools such as image manipulation, upload, email, etc.
ASP is very slowPHP is way faster
ASP works better with SQL Server and Access. I have not used it with MySQL, because it does not make sense. PHP works very very well with MySQL. It works fine with SQL Server, SQL Server is costly.

PHP VS JSP

JSP PHP
JSP is Java and based on the J2EE specificationsPHP is PHP
JSP has strong typed data. All variables should be declared. Most of these components are not free PHP has flexible, variable behave 'naturally' although they all have a type defined behind the scenes (like integer, string, etc)
JSP is Object-oriented, alwaysIn PHP You can mix in Object-oriented stuff to your liking.
JSP is really resident and running on a server, so you always have some running processes you can use for timers, etc. In PHP you can fire up the PHP-engine when a request arrives from a client. So if you need scheduled tasks, you have to fall back to cron and the like.
Advantages Of PHP
  1. Reduce the time to create large websites.
  2. Create a customized user experience for visitors based on information that you have gathered from them.
  3. Open up thousands of possibilities for online tools. Check out PHP - Hot Scripts for examples of the great things that are possible with PHP.
  4. Allow creation of shopping carts for e-commerce websites.
Disadvantages Of PHP
  1. PHP is not pure Object Oriented scripting language.
  2. PHP has very poor handling errors qualities