SlideShare uma empresa 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/

Mais conteúdo relacionado

Destaque

Destaque (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
 

Semelhante a PHP Introduction

Semelhante 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
 

Mais de J.T.A.JONES

Mais 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

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 

Último (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 

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/