PHP - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

PHP

Description:

PHP code is embedded using start and end tags. There are 4 possible sets of tags you can use ... 4 - % echo('ASP style'); % PHP tags. 1 and 3 are always available ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 10
Provided by: capi7
Category:
Tags: php | style

less

Transcript and Presenter's Notes

Title: PHP


1
PHP
  • PHP Personal Home Pages
  • PHP is a Hypertext Preprocessor
  • For dynamic web pages
  • Created in 1994 by Rasmus Lerdorf
  • Use in gt 1.5 million web sites, growing
  • Server-side scripting language

2
PHP
  • PHP is an open-source software
  • www.php.net
  • Can download for free
  • Can interact with database (MySQL for us)
  • Can be used with Unix, Linux (for us ), Windows,
    ..

3
PHP
  • Need a Web server (Apache for us)
  • Need PHP
  • All files in .php are handled by the server
    (default)
  • PHP scripts are parsed and interpreted on the
    server side of a web application
  • Resulting output is sent to web browser for
    display

4
PHP
  • PHP is a template
  • PHP code for server scripting HTML with embedded
    PHP code in it
  • PHP code is embedded using start and end tags
  • There are 4 possible sets of tags you can use

5
PHP tags
  • 1 - lt?php echo(Hi) ?gt
  • 2 - lt? echo(Hi) ?gt
  • 3 - ltscript language phpgt
  • echo(Hi)
  • lt/scriptgt
  • 4 - lt echo(ASP style) gt

6
PHP tags
  • 1 and 3 are always available
  • 2 needs to be enabled (it is for us)
  • 4 needs to enable ASP tags (it is not for us)
  • Preferred 1 allows XML

7
PHP 1st example
  • In file helloworld.php
  • lthtmlgtlttitlegtPHP testlt/titlegtltbodygt
  • lt?
  • echo(Hi)
  • ?gt
  • lt/bodygtlt/htmlgt

8
PHP echo and print
  • PHP has 2 functions for output
  • print and echo
  • print returns 1 (success) or 0 (failure)
  • Also printf and sprintf
  • For reserved characters, use \ to escape them
  • echo She said \Hi!\

9
PHP comments
  • Same as Java, C (and Perl)
  • // single line comment
  • / multi
  • line
  • comment /
  • a Perl style comment
Write a Comment
User Comments (0)
About PowerShow.com