Vous êtes sur la page 1sur 2

PHPstands for PHP Hypertext Processor.

It is an open source software so you can easily download it from its site; www.php.net. PHP is a mixture of various languages like Java, C and Perl. It was designed with the intention of producing dynamic and interactive web pages. It is capable of producing standalone graphical web applications. Another important fact about PHP is that it can be used as a procedural language in order to create complex objects. PHP is probably the most popular scripting language on the web. It is used to enhance web pages. With PHP, you can do things like create username and password login pages, check details from a form, create forums, picture galleries, surveys, and a whole lot more. If you've come across a web page that ends in PHP, then the author has written some programming code to liven up the plain, old HTML. PHP is known as a server-sided language. That's because the PHP doesn't get executed on your computer, but on the computer you requested the page from. The results are then handed over to you, and displayed in your browser. Other scripting languages you may have heard of are ASP, Python and Perl. (You don't need to know any of these to make a start on PHP. In fact, these tutorials assume that you have no programming experience at all.) PHP was originally a personal project called as Personal Home Page Tools developed by Rasmus Lerdorf in the year 1994. That was the original version of PHP which consisted of some basic web tools, a parser and some macros. After a while, in the year 1997, the parser was again rewritten and this parser became the basis of PHP3 that gained remarkable popularity. After that, PHP continued to grow and version 4 included a new parser with added features. Today, all the PHP implementations are produced by the PHP group. Now, as you have learnt some basics of PHP, we shall try building a simple PHP application that will demonstrate you and will help you in learning 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 First of all, you must be aware of the fact that you should have some knowledge of HTML because PHP code is directly embedded into HTML code. 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" PHP syntax is very simple; every scripting block of PHP starts with <?php and ends with ?>. You can place this scripting block anywhere in the document. PHP scripts are always enclosed in between two PHP tags. This tells your server to parse the information between them as PHP. The three different forms are as follows: <? PHP Code In Here ?> <?php PHP Code In Here php?> <script language="php"> PHP Code In Here </script> All of these work in exactly the same way but you must remember, though, to start and end your code with the same tag (you can't start with <? and end with </script> for example). <html><body><?php echo Hello World; ?> </body> </html>

Echo is used to write output to the browser screen. The most important point here to remember is that, like C, every line of code in PHP ends up with a semi colon. Echo can be replaced with print to get the same functionality. If anyone of you has ever worked on C programming language, you would have noticed the similarity between C and PHP. <? phpinfo(); ?> As you can see this actually just one line of code. It is a standard PHP function called phpinfo which will tell the server to print out a standard table of information giving you information on the setup of the server. 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

To get access to a web server with PHP support, you can: Install Apache (or IIS) on your own server, install PHP, and MySQL There are two basic statements to output text with PHP: echo and print. In the example above we have used the echo statement to output the text "Hello World". Note: The file must have a .php extension. If the file has a .html extension, the PHP code will not be executed. Comments in PHP

Vous aimerez peut-être aussi