php tutorial for beginners

 php introduction

PHP was running on more than 1 million hosts in November 1999. As of

September 2001, that figure had already risen to over 6 million hosts, and by October 2003 PHP was

reportedly installed on almost 14 million hosts. According to SecuritySpace.com, PHP is the most

popular Apache module available, beating mod_ssl, Perl, and FrontPage.

PHP is also installed as a command-line application, making it an excellent tool for scripting

on a server. Many system administrators now use PHP for the sort of automation that has been

traditionally handled by Perl or shell scripting.


What is Php ? 

• PHP stands for PHP: Hypertext Preprocessor 

• PHP is a server-side scripting language, like ASP 

• PHP scripts are executed on the server 

• PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, 

PostgreSQL, Generic ODBC, etc.) 

• PHP is an open source software 

• PHP is free to download and use


What is a PHP File?

• PHP files can contain text, HTML tags and scripts 

• PHP files are returned to the browser as plain HTML 

• PHP files have a file extension of ".php", ".php3", or ".phtml"


Why php ?

• PHP runs on different platforms (Windows, Linux, Unix, etc.) 

• PHP is compatible with almost all servers used today (Apache, IIS, etc.) 

• PHP is FREE to download from the official PHP resource: www.php.net

• PHP is easy to learn and runs efficiently on the server side


Explain Features of PHP

• PHP stands for Hypertext Preprocessor“. It is a widely-used Open Source general-

purpose scripting language that is especially suited for Web development and can be 

embedded into HTML. 

• It is an interpreted language.

There are three main fields where PHP scripts are used. 

1. Server side scripting 

2. Command line scripting. 

3. Writing client-side GUI applications.For this PHP-GTK is used. 

PHP-GTK is an extension for the PHP programming language that implements 

language bindings for GTK+. It provides an object-oriented interface to GTK+ classes 

and functions and greatly simplifies writing client-side cross-platform GUI 

applications. 

• PHP can be used on all major operating systems, including Linux, many Unix 

variants, Microsoft Windows, Mac OS X etc. 

• PHP has also support for most of the web servers today. This includes Apache, 

Microsoft Internet Information Server, Personal Web Server, Netscape and iPlanet 

servers, Oreilly Website Pro server and many others. 

• You also have the choice of using procedural programming or object oriented 

programming, or a mixture of them. 

• PHP does more than just generating dynamic web-pages. 

PHP's abilities includes: 

• Generating images dynamically 

• PDF files 

• Flash movies 

• Compression 

• Download and upload 

• XML support 

• PHP also has support for talking to other services using protocols such as LDAP, 

IMAP, SNMP, NNTP, POP3, HTTP, COM (on Windows) and countless others. 

• You can also open raw network sockets and interact using any other protocol. 

• PHP has support for the WDDX complex data exchange between virtually all Web 

programming languages. (Support for web services) 

• PHP has support for instantiation of Java objects and using them transparently as PHP 

objects. You can also use CORBA extension to access remote objects.


Hello World" Script in PHP:

To get a feel for PHP, first start with simple PHP scripts. Since "Hello, World!" is an essential

example, first we will create a friendly little "Hello, World!" script.

PHP is embedded in HTML. That means that in amongst your normal HTML (or XHTML if

you're cutting-edge) you'll have PHP statements like this:

<html>

<head>

<title>Hello World</title>

<body>

<?php echo "Hello, World!";?>

</body>

</html>

It will produce following result:

Hello, World!

If you examine the HTML output of the above example, you'll notice that the PHP code is not

present in the file sent from the server to your Web browser. All of the PHP present in the Web page

is processed and stripped from the page; the only thing returned to the client from the Web server

is pure HTML output.






Post a Comment

0 Comments