Sunteți pe pagina 1din 10

Brief Introduction

of PHP
---Xue Wu

PHP (Personal Home Page)


Web development
1. can be embedded into HTML
2. generally runs on a web server
3. Act as a filter:
(from PHP 4, performance improved by
complied input as bytecode)
4. widely used and free charge

PHP-Characteristics
Database Connected (eg. PHP&MySQL)
Compatible
Object Oriented Programming

PHP--- example
Grammatical:
---Can be both embedded into HTML and
separated from HTML code:
<? . . . ?>
<?php . . . ?> (XML passers )
<script language="php"> . . . </script>
<% . . . %>

PHP---Usage

Competitor:

Microsofts Active Server Page


Sun Microsystems Java Server Page
Mode_perl

Rapid Application Development (RAD)

Cake PHP, PRADO, Symfony, Codelgniter

PHP--- example
Annotation:
/*C style, Multiple lines*/
// C style one line
#Unix Style

PHP--- Interaction with THML:


echo
Can output multiple strings:
<?
$a="hello";
$b="world";
echo "a","b";
?>
---result: hello world

Print
Can only output single string:
<?
$a="hello";
$b="world";
print "a","b";
?>
---Parse error: parse error in
d:adminmyphphometest.p
hp3 on line 54

PHP---Security

1.
2.
3.
4.

To prevent from damaging on your website


Error Report
SQL Injections
Cross Site Scripting
Session Security

PHP---Security
5. Directory traversal
6. Cross-site request forgery
7. Remote file inclusion

Reference
http://en.wikipedia.org/wiki/PHP last
retrieved on 2009-2-28
http://www.phpchina.com/?action_thematici
nfoview_itemid_34132.html PHP tutorial,
last retrieved on 2009-2-28
http://www.phpfreaks.com/tutorial/phpsecurity/page9 PHP Security, last retrieved
on 2009-3-1

S-ar putea să vă placă și