what is php? php (recursive acronym for "php: hypertext preprocessor") is a widely-used...
TRANSCRIPT
![Page 1: What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general- purpose scripting language that is especially](https://reader036.vdocuments.us/reader036/viewer/2022082322/56649e745503460f94b74c11/html5/thumbnails/1.jpg)
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.
![Page 2: What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general- purpose scripting language that is especially](https://reader036.vdocuments.us/reader036/viewer/2022082322/56649e745503460f94b74c11/html5/thumbnails/2.jpg)
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:
1. The PHP parser (CGI or server module)
2. A web browser
3. A webserver with a connected PHP installation.
All these can run on your home machine if you are just experimenting with PHP programming.
![Page 3: What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general- purpose scripting language that is especially](https://reader036.vdocuments.us/reader036/viewer/2022082322/56649e745503460f94b74c11/html5/thumbnails/3.jpg)
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.
![Page 4: What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general- purpose scripting language that is especially](https://reader036.vdocuments.us/reader036/viewer/2022082322/56649e745503460f94b74c11/html5/thumbnails/4.jpg)
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.
![Page 5: What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general- purpose scripting language that is especially](https://reader036.vdocuments.us/reader036/viewer/2022082322/56649e745503460f94b74c11/html5/thumbnails/5.jpg)
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
![Page 6: What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general- purpose scripting language that is especially](https://reader036.vdocuments.us/reader036/viewer/2022082322/56649e745503460f94b74c11/html5/thumbnails/6.jpg)
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
![Page 7: What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general- purpose scripting language that is especially](https://reader036.vdocuments.us/reader036/viewer/2022082322/56649e745503460f94b74c11/html5/thumbnails/7.jpg)
19/562,759 Domains, 1,305,799 IP Addresses
![Page 8: What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general- purpose scripting language that is especially](https://reader036.vdocuments.us/reader036/viewer/2022082322/56649e745503460f94b74c11/html5/thumbnails/8.jpg)
Simple Web Page Example:helloworld.php
<html> <head> <title>Example</title> </head> <body>
<?php echo ‘Hello, world!’; ?>
</body></html>
![Page 9: What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general- purpose scripting language that is especially](https://reader036.vdocuments.us/reader036/viewer/2022082322/56649e745503460f94b74c11/html5/thumbnails/9.jpg)
The GutsVariables:
- 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
![Page 10: What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general- purpose scripting language that is especially](https://reader036.vdocuments.us/reader036/viewer/2022082322/56649e745503460f94b74c11/html5/thumbnails/10.jpg)
The GutsFunctions:
- 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
<?phpfunction fooFunction($arg1, $arg2 = '') { if (condition) { statement; } return $val;}?>
![Page 11: What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general- purpose scripting language that is especially](https://reader036.vdocuments.us/reader036/viewer/2022082322/56649e745503460f94b74c11/html5/thumbnails/11.jpg)
The GutsClasses:
- more forgiving than in C++, VB, C# or similar approaches- excellent way to encapsulate and control code
<?phpclass clsFoo { var $my_color = ‘green’;
function clsFoo ($arg1) {
$this->my_color = $arg1; } }?>
![Page 12: What is PHP? PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general- purpose scripting language that is especially](https://reader036.vdocuments.us/reader036/viewer/2022082322/56649e745503460f94b74c11/html5/thumbnails/12.jpg)
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)