1 / 12

What is PHP?

What is PHP?. PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. What can PHP do?. Server-side Scripting:.

zoey
Download Presentation

What is PHP?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.

  2. What can PHP do? Server-side Scripting: • This is the most traditional and main target field for PHP. You need three things to make this work: • The PHP parser (CGI or server module) • A web browser • A webserver with a connected PHP installation. • All these can run on your home machine if you are just experimenting with PHP programming.

  3. What can PHP do? Command Line Scripting: You can make a PHP script to run it without any server or browser. You only need the PHP parser to use it this way. This type of usage is ideal for scripts regularly executed using cron (on *nix or Linux) or Task Scheduler (on Windows). These scripts can also be used for simple text processing tasks.

  4. What can PHP do? Desktop Applications: Writing desktop applications. PHP is probably not the very best language to create a desktop application with a graphical user interface, but if you know PHP very well, and would like to use some advanced PHP features in your client-side applications you can also use PHP-GTK to write such programs. You also have the ability to write cross-platform applications this way.

  5. Database Strength: Adabas D InterBase PostgreSQL dBase FrontBase SQLite Empress mSQL Solid FilePro (read-only) Direct MS-SQL Sybase Hyperwave MySQL Velocis IBM DB2 ODBC Unix dbm Informix Oracle (OCI7 and OCI8) Ingres Ovrimos

  6. Ubiquitous Setups: • Most commonly used with Apache Web Server as module • Most commonly used with MySQL Database Server • Most commonly used on the Linux platform Additional Common Setups: • Growing number of installations on Windows machines • Local development setups are popular

  7. 19/562,759 Domains, 1,305,799 IP Addresses

  8. Simple Web Page Example:helloworld.php <html>   <head>       <title>Example</title>   </head>   <body><?phpecho ‘Hello, world!’; ?>   </body></html>

  9. The Guts Variables: - variables are given a value at declaration but not a type $foo = 0; - always preceded by the dollar sign: $ - vars can be converted to common specific types (int, variant, etc.) - typical scope rules apply, but global command may be used for public or global variables

  10. The Guts Functions: - typically declared in “global” files that are included by all your other website pages -> keep them in one place - optionally with arguments and can return values <?php function fooFunction($arg1, $arg2 = '') { if (condition) { statement; } return $val; } ?>

  11. The Guts Classes: - more forgiving than in C++, VB, C# or similar approaches - excellent way to encapsulate and control code <?php class clsFoo { var $my_color = ‘green’; function clsFoo ($arg1) { $this->my_color = $arg1; } } ?>

  12. Where to Start? • www.php.net • www.phpmyadmin.net (best free MySQL management tool) • www.mysql.org (.com) • www.apache.org (version 1.3.x recommended for a local install) • www.jtlnet.com (cheap php/mysql hosting – tons out there) • www.phpbuilder.com (coding resource) • www.zend.com (Zend Studio 5.x – Visual Studio-type IDE)

More Related