SlideShare una empresa de Scribd logo
1 de 20
Introduction

 History
 Language syntax
 Advantages
An established server-side, cross-platform
embedded HTML scripting language for
creating dynamic Web pages.

PHP provides many features that
commercial entities are looking for.
Exceptionally short learning curve
•
• Quick development time
• Very high performance
• supports all major platforms
  (UNIX, Windows and even mainframes).
• Features native support for most popular
  databases
quot;PHP was built with the needs of Web
 developers in mind... Unlike other
 cumbersome, overhead-laden
 approaches, PHP is lightweight and
 focused on the Web - where it can solve
 complex problem scenarios quicker and
 more easily than comparable
 technologies.quot;
1994 - PHP was conceived sometimes in the Fall

    of 1994 by Rasmus Lerdorf
    1995 - PHP/FI Version 2. ( Introducing mySql

    data base)
    1997 – approximately 50,000 web sites.

    Introducing PHP Version 3.
    (Zeev Suraski and Andi Gutmans )
    2000 – PHP 4 was introduced, using “Zend”

    scripting engine. ( 5.1 million web sites. )
Treated just like regular HTML pages and

  you can create and edit them the same
  way you normally create regular HTML
  pages.
 As simple as HTML files with a whole new
  family of magical tags that let you do all
  sorts of things.
File name : Hello.php
<html><head><title>PHP
Test</title></head>
<body>
<?php echo quot;Hello World<p>quot;; ?>
</body></html>
Condition statements, loop statements,

    arrays ...
    Built in libraries. (sorting, list, queue..)

    Functions.

    Classes. ( Objects, Inheritance .. )

    String Manipulation. ( Perl )

    Built in support for encryption/Decryption

    functions.( MD5, DES, …)
Text files manipulation. ( Read, write, ..)

 Supports java objects, COM
  objects ...
 Sessions, cookies …
<?php echo $HTTP_USER_AGENT; ?>
•
Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)


    <?php phpinfo(); ?>
•
    A list of all the global variables.
<?php
if(strstr($HTTP_USER_AGENT,quot;MSIEquot;
)) {?>
<center><b>You are using Internet
Explorer</b></center>
<?} else { ?>
<center><b>You are not using Internet
Explorer</b></center>
<?} ?>
One of the most powerful features of PHP

  is the way it handles HTML forms
 Any form element in a form will
  automatically result in a variable with the
  same name as the element being
  created on the target page.
HTML Page:
•
    <form action=quot;action.phpquot; method=quot;postquot;>
    Your name: <input type=quot;textquot; name=quot;namequot;>
    You age: <input type=quot;textquot; name=quot;agequot;>
    <input type=quot;submitquot;>
    </form>


    action.php.
•
    Hi <?php echo $name; ?>.
    You are <?php echo $age; ?> years old.
mySQL - PHP and MySQL work very well

  together, in addition to the speed and
  features of each individual tool.
 PHP is open-source, and offers excellent
  connectivity to most of today's common
  databases including
  Oracle, Sybase, MySQL, ODBC (and others).
 PHP also offers integration with various
  external libraries which enable the
  developer to do anything from generating
  PDF documents to parsing XML.
Connect to MySQL.

 Send a query.
 Print a table heading.
 Print table rows until end of the table has
  been reached.
<?php

$conn = mysql_connect(quot;localhostquot;, “ya
ronquot;, quot;quot;);
$res = mysql_query(quot;SELECT * FROM user
squot;, $conn);
$header_printed = false;
print quot;<TABLE>nquot;;
do {
    $data = mysql_fetch_array($res);

   // Retrieve the next row of data.

   if (!is_array($data)) {
       break;
   }
if (!$header_printed) {
        print quot; <TR>quot;;
        reset($data);
        while (list($name, $value) = each($data)) {
            print quot; <TH>$name</TH>nquot;
        }
        print quot; </TR>nquot;;
        $header_printed = true;
    }
    print quot; <TR>nquot;;
    print quot; <TD>quot;;

    print implode(quot;</TD>n   <TD>quot;, $data);
    print quot; </TR>nquot;;
} while ($data);
print quot;</TABLE>nquot;;

?>
Speed and robustness.

 Superior Memory Management
 No Hidden Costs with PHP
 Integration with MySQL database.
 Closer to Java/C++ Style of
  Programming.
 No Show Stopper Bugs.
 Cross Platform Migration Strategy.
PHP Homepage: http://www.php.net

 PHP-to-MySQL database tutorial:
  http://www.devshed.com/
  resource/advanced/php3/intro/index.ht
  ml
 Zend.com: http://www.Zend.com/

Más contenido relacionado

Destacado

Destacado (7)

MYSQL
MYSQLMYSQL
MYSQL
 
5-WebServers.ppt
5-WebServers.ppt5-WebServers.ppt
5-WebServers.ppt
 
Guide
GuideGuide
Guide
 
Data types in php
Data types in phpData types in php
Data types in php
 
Securing the Apache web server
Securing the Apache web serverSecuring the Apache web server
Securing the Apache web server
 
Apache web server
Apache web serverApache web server
Apache web server
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 

Similar a PHP Introduction

Similar a PHP Introduction (20)

Php intro
Php introPhp intro
Php intro
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
PHP Hypertext Preprocessor
PHP Hypertext PreprocessorPHP Hypertext Preprocessor
PHP Hypertext Preprocessor
 
Phpwebdevelping
PhpwebdevelpingPhpwebdevelping
Phpwebdevelping
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Php intro
Php introPhp intro
Php intro
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Phpwebdev
PhpwebdevPhpwebdev
Phpwebdev
 
PHP
PHPPHP
PHP
 
php (Hypertext Preprocessor)
php (Hypertext Preprocessor)php (Hypertext Preprocessor)
php (Hypertext Preprocessor)
 
HackU PHP and Node.js
HackU PHP and Node.jsHackU PHP and Node.js
HackU PHP and Node.js
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 

Más de J.T.A.JONES

Más de J.T.A.JONES (20)

Seismic
SeismicSeismic
Seismic
 
Fire Detection and Alarm Systems
Fire Detection and Alarm SystemsFire Detection and Alarm Systems
Fire Detection and Alarm Systems
 
Productivity
ProductivityProductivity
Productivity
 
Public Switched Telephone Network (PSTN)
Public Switched Telephone Network (PSTN)Public Switched Telephone Network (PSTN)
Public Switched Telephone Network (PSTN)
 
Video phone
Video phoneVideo phone
Video phone
 
navigation
navigationnavigation
navigation
 
Radar
RadarRadar
Radar
 
safety belts
safety beltssafety belts
safety belts
 
Safety
SafetySafety
Safety
 
Powder Metallurgy
Powder Metallurgy Powder Metallurgy
Powder Metallurgy
 
Die Casting
Die Casting Die Casting
Die Casting
 
Casting
CastingCasting
Casting
 
Fuel Systems
Fuel SystemsFuel Systems
Fuel Systems
 
Carburetor Theory
Carburetor TheoryCarburetor Theory
Carburetor Theory
 
Software Development Life Cycle Model
Software Development Life Cycle ModelSoftware Development Life Cycle Model
Software Development Life Cycle Model
 
Types of os
Types of osTypes of os
Types of os
 
IO Management
IO ManagementIO Management
IO Management
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Sorting & Linked Lists
Sorting & Linked ListsSorting & Linked Lists
Sorting & Linked Lists
 
Transformer
TransformerTransformer
Transformer
 

Último

Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptxmary850239
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxAneriPatwari
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Celine George
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesVijayaLaxmi84
 

Último (20)

Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their uses
 

PHP Introduction

  • 1.
  • 3. An established server-side, cross-platform embedded HTML scripting language for creating dynamic Web pages. PHP provides many features that commercial entities are looking for.
  • 4. Exceptionally short learning curve • • Quick development time • Very high performance • supports all major platforms (UNIX, Windows and even mainframes). • Features native support for most popular databases
  • 5. quot;PHP was built with the needs of Web developers in mind... Unlike other cumbersome, overhead-laden approaches, PHP is lightweight and focused on the Web - where it can solve complex problem scenarios quicker and more easily than comparable technologies.quot;
  • 6. 1994 - PHP was conceived sometimes in the Fall  of 1994 by Rasmus Lerdorf 1995 - PHP/FI Version 2. ( Introducing mySql  data base) 1997 – approximately 50,000 web sites.  Introducing PHP Version 3. (Zeev Suraski and Andi Gutmans ) 2000 – PHP 4 was introduced, using “Zend”  scripting engine. ( 5.1 million web sites. )
  • 7. Treated just like regular HTML pages and  you can create and edit them the same way you normally create regular HTML pages.  As simple as HTML files with a whole new family of magical tags that let you do all sorts of things.
  • 8. File name : Hello.php <html><head><title>PHP Test</title></head> <body> <?php echo quot;Hello World<p>quot;; ?> </body></html>
  • 9. Condition statements, loop statements,  arrays ... Built in libraries. (sorting, list, queue..)  Functions.  Classes. ( Objects, Inheritance .. )  String Manipulation. ( Perl )  Built in support for encryption/Decryption  functions.( MD5, DES, …)
  • 10. Text files manipulation. ( Read, write, ..)   Supports java objects, COM objects ...  Sessions, cookies …
  • 11. <?php echo $HTTP_USER_AGENT; ?> • Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0) <?php phpinfo(); ?> • A list of all the global variables.
  • 12. <?php if(strstr($HTTP_USER_AGENT,quot;MSIEquot; )) {?> <center><b>You are using Internet Explorer</b></center> <?} else { ?> <center><b>You are not using Internet Explorer</b></center> <?} ?>
  • 13. One of the most powerful features of PHP  is the way it handles HTML forms  Any form element in a form will automatically result in a variable with the same name as the element being created on the target page.
  • 14. HTML Page: • <form action=quot;action.phpquot; method=quot;postquot;> Your name: <input type=quot;textquot; name=quot;namequot;> You age: <input type=quot;textquot; name=quot;agequot;> <input type=quot;submitquot;> </form> action.php. • Hi <?php echo $name; ?>. You are <?php echo $age; ?> years old.
  • 15. mySQL - PHP and MySQL work very well  together, in addition to the speed and features of each individual tool.  PHP is open-source, and offers excellent connectivity to most of today's common databases including Oracle, Sybase, MySQL, ODBC (and others).  PHP also offers integration with various external libraries which enable the developer to do anything from generating PDF documents to parsing XML.
  • 16. Connect to MySQL.   Send a query.  Print a table heading.  Print table rows until end of the table has been reached.
  • 17. <?php $conn = mysql_connect(quot;localhostquot;, “ya ronquot;, quot;quot;); $res = mysql_query(quot;SELECT * FROM user squot;, $conn); $header_printed = false; print quot;<TABLE>nquot;; do { $data = mysql_fetch_array($res); // Retrieve the next row of data. if (!is_array($data)) { break; }
  • 18. if (!$header_printed) { print quot; <TR>quot;; reset($data); while (list($name, $value) = each($data)) { print quot; <TH>$name</TH>nquot; } print quot; </TR>nquot;; $header_printed = true; } print quot; <TR>nquot;; print quot; <TD>quot;; print implode(quot;</TD>n <TD>quot;, $data); print quot; </TR>nquot;; } while ($data); print quot;</TABLE>nquot;; ?>
  • 19. Speed and robustness.   Superior Memory Management  No Hidden Costs with PHP  Integration with MySQL database.  Closer to Java/C++ Style of Programming.  No Show Stopper Bugs.  Cross Platform Migration Strategy.
  • 20. PHP Homepage: http://www.php.net   PHP-to-MySQL database tutorial: http://www.devshed.com/ resource/advanced/php3/intro/index.ht ml  Zend.com: http://www.Zend.com/