Athena Giao Trinh Php Mysql

May 28, 2016 | Author: khucgo | Category: N/A
Share Embed Donate


Short Description

Download Athena Giao Trinh Php Mysql...

Description

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA WWW.ATHENA.EDU.VN. TEL : 1900 54 54 56 – 090 7879 477

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

Enjoy PHPing AND ATHENA!

TABLE OF CONTENTS Chapter 1. Web Design Basic ..........................................................................................7 Web Design Toolbox..................................................................................................... 9 HTML Editor – Dreamweaver CS3 .............................................................................. 16 HTML Basics................................................................................................................ 22 HTML Form ................................................................................................................. 23 CSS .............................................................................................................................. 27 Javascript .................................................................................................................... 28 Chapter 2. PHP Workspace ...........................................................................................31 PHP Introduction ........................................................................................................ 33 AppServ Installation ................................................................................................... 35 Using AppServ ............................................................................................................ 37 PHP IDE - PhpEd.......................................................................................................... 38 Using PHP Interactive ................................................................................................. 42 Chapter 3. PHP Basics ...................................................................................................45 PHP Syntax.................................................................................................................. 47 Data Types .................................................................................................................. 48 Variable & Constant ................................................................................................... 49 Operators ................................................................................................................... 50 VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

2

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477 Control Structure ........................................................................................................ 51 Chapter 4. Function ......................................................................................................55 Introduction................................................................................................................ 57 Syntax ......................................................................................................................... 57 Parameter & Argument .............................................................................................. 58 Useful Functions ......................................................................................................... 61 Chapter 5. Array ...........................................................................................................63 Declaration ................................................................................................................. 65 Array Operation .......................................................................................................... 65 Iteration (Looping)...................................................................................................... 67 Sorting ........................................................................................................................ 68 More Functions .......................................................................................................... 70 Chapter 6. String Manipulation ....................................................................................73 Declaration ................................................................................................................. 75 Comparision ............................................................................................................... 75 Searching .................................................................................................................... 76 Replacement............................................................................................................... 76 Splitting....................................................................................................................... 77 Formatting .................................................................................................................. 78 Regular Expression – RegEx ........................................................................................ 79 Chapter 7. HTTP Basic...................................................................................................83 HTTP Fundamentals.................................................................................................... 85 File Upload.................................................................................................................. 88 Cookie ......................................................................................................................... 90 Session ........................................................................................................................ 91 Chapter 8. OOP – Object Oriented Programming .........................................................93 OOP Fundamentals..................................................................................................... 95 Properties ................................................................................................................... 96 Methods ..................................................................................................................... 97 Inheritance & Overriding .......................................................................................... 101 Chapter 9. File Handling ............................................................................................. 107 File Handle ................................................................................................................ 109 File Manipulation...................................................................................................... 110 Directory ................................................................................................................... 112 File & Directory Constants........................................................................................ 113 VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

3

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477 Chapter 10. MySQL..................................................................................................... 115 DBMS Fundamentals ................................................................................................ 117 MySQL Fundamentals............................................................................................... 118 MySQL Basics ............................................................................................................ 122 Using phpMyAdmin .................................................................................................. 125 MySQL in PHP ........................................................................................................... 138 Chapter 11. Logging & Debugging .............................................................................. 141 Log Configuration ..................................................................................................... 143 PhpEd Debugger Installation .................................................................................... 143 Debugging................................................................................................................. 145 Chapter 12. OOP Advanced ........................................................................................ 149 Interface ................................................................................................................... 151 Abstract Class, Method ............................................................................................ 152 Final Class, Method .................................................................................................. 153 Lazy Loading ............................................................................................................. 154 Magic Methods......................................................................................................... 154 Chapter 13. MySQL Advanced .................................................................................... 159 Table Joining ............................................................................................................. 161 PHP Data Object (PDO) ............................................................................................. 164 Chapter 14. Software Engineering Basic ..................................................................... 167 Requirement Gathering............................................................................................ 169 Use-Case Diagram .................................................................................................... 171 Class Diagram ........................................................................................................... 177 Chapter 15. XML & Web Service ................................................................................. 181 XML Basics ................................................................................................................ 183 SimpleXML Class ....................................................................................................... 184 Web Services Basics.................................................................................................. 185 SOAP ......................................................................................................................... 186 JSON Overview ......................................................................................................... 189 Chapter 16. Security ................................................................................................... 191 Security Basics .......................................................................................................... 193 Database Security ..................................................................................................... 193 Website Security....................................................................................................... 194 Session Security ........................................................................................................ 199 File System Security.................................................................................................. 201 VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

4

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477 Chapter 17. Advanced PHP Topics .............................................................................. 203 PHP.INI File Overview ............................................................................................... 205 Date & Time.............................................................................................................. 206 Email Sending ........................................................................................................... 208 Image Processing ...................................................................................................... 209 cURL library .............................................................................................................. 210 Smarty ...................................................................................................................... 211 Different between PHP5 & PHP4 ............................................................................. 212 Chapter 18. Design Pattern ........................................................................................ 215 Fundamentals ........................................................................................................... 217 Singleton Pattern ...................................................................................................... 217 Factory Pattern ......................................................................................................... 218 Strategy Pattern ....................................................................................................... 220 Model-View-Controller (MVC) Pattern .................................................................... 221 Chapter 19. E-Commerce Website .............................................................................. 225 E-Commerce Fundamentals ..................................................................................... 227 Website Optimization............................................................................................... 228 SEO Basics ................................................................................................................. 228 Website Analytic – Google Analytic Setup ............................................................... 230 Chapter 20. Zend PHP 5 Certification – ZCE (Zend Certified Engineer)........................ 243 Zend Certification Introduction ................................................................................ 245 Zend PHP 5 Certification Exam ................................................................................. 246 Further Reading.......................................................................................................... 249 UseFul Websites ......................................................................................................... 250

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

5

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

Chapter 1

Web Design Basics Keywords: Web design, editor, tool, photo, form, html, tag, style, javascript.

Subjects: 1.1. Web Design Toolbox 1.2. HTML Editor – Dreamweaver CS3 1.3. HTML Basics 1.4. HTML Form 1.5. CSS 1.6. Javascript

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

6

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

1.1. Web Design Toolbox: 1.1.1. Image Manipulating: Photoshop, GIMP, Illustrator…

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

7

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

8

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

1.1.2. Animation Creator: Photoshop, Flash, Flex, Maya, 3DS Max…

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

9

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

10

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

11

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

1.1.3. HTML Editor: Dreamweaver, Notepad++…

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

12

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

13

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

1.1.4. CSS Editor: Dreamweaver, Rapid CSS, Notepad++…

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

14

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

15

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

1.1.5. Javascript Editor: Dreamweaver, 1st Javascript Editor, Notepad++…

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

16

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

1.2. HTML Editor – Dreamweaver CS3: - Main Dreamweaver CS3 interface

- Auto-complete function

- Collapse selected script: VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

17

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- Property Inspector Panel:

- Create a Local Site:

Or:

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

18

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

Or:

- After creating site, the FILES panel will become:

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

19

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- Open an Local Site:

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

20

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- Manage Site Files: In the Files Panel, right click the root (top level) and select your function (New File, New Folder…)

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

21

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- Create new file

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

22

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

1.3. HTML Basics: VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

23

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

1.3.1. HTML Structure: Four Square Cafe Four Square Café is located at the intersection of Melrose and Sunset Avenues in Los Angeles. We are a cafe with our own bakery, and also have a charcuterie for your favorite meats and cheeses. We offer breakfasts and made to order sandwiches. You can buy fresh, hot from the oven bread for your home twice a day, at 8 am and 5 am daily. In our Café, we are also famous for fresh organic coffee and tea made with mountain water. Each cup is in its own single cone and paper filter and dripped right into your cup. We then start over for the next customer. Today's Specials ....................content deleted ..............................



1.3.2. Popular HTML Tag: - Break line: br - Heading: h1, h2, h3, h4, h5, h6. - Paragraph: p - Link: a - Image: img - Text formatting: b, i, strong - Tables: table, tr, th, td - List: ul, ol, dl, li - Form: form, input, textarea, select VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

24

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- DIV, SPAN Tag: div, span

1.3.3. HTML Meta Tag:

1.4. HTML Form: 1.4.1. Using Dreamweaver to insert Form element:

1.4.2. Form Elements: VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

25

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

1.4.2.1. Text Field: Name: Password:

1.4.2.2. Button: Name: Password:

1.4.2.3. Radio button: What kind of shirt are you wearing? Shade: Dark Light Size:

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

26

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

1.4.2.4. Check box: Select your favorite cartoon characters. Goofy Donald Bugs Bunny Scooby Doo

1.4.2.5. Dropdown list: College Degree? Choose One Some High School High School Degree Some College Bachelor's Degree Doctorate

1.4.2.6. Selection form: Musical Taste Emo Metal/Rock Hip Hop VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

27

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477 Ska Jazz Country Classical Alternative Oldies Techno

1.4.2.7. Upload form:

1.4.2.8. Text Area: Enter Comments Here

1.5. CSS: 1.5.1. CSS Selector: - The selector name creates a direct relationship with the HTML tag you want to edit. - Many types of selector: type, class, id, child, universal… VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

28

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- Ex: …

1.5.2. CSS Syntax: SELECTOR { PROPERTY: VALUE }

1.5.3. Embed CSS to HTML page: - Internal CSS: p {color: white; } body {background-color: black; }

- External CSS:

- Inline CSS: Text

1.6. Javascript: 1.6.1. Embed Javascript to HTML page: - Internal: //script here

- External:

- Inline: VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

29

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

1.6.2. Javascript Basics: 1.6.2.1. Comments: // this is a comment /* so is this */

1.6.2.2. Function: function anExample(param1,param2) { alert(param1+param2); }

15.1.3.2. External DTD: Tove Jani Reminder Don't forget me this weekend!

"note.dtd" file:

15.2. SimpleXML Class: 15.2.1. Load XML Data: - Load an XML String: $xmlstr = file_get_contents('book.xml'); $booklib = simplexml_load_string($xmlstr);

- Load an XML File: $booklib = simplexml_load_file('book.xml');

- Load an XML String – using OOP: $xmlstr = file_get_contents('book.xml'); $booklib = new SimpleXMLElement($xmlstr);

- Load an XML File – using OOP: $booklib = new SimpleXMLElement('book.xml', NULL, true);

15.2.2. Simple Read XML Data: VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

182

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477 foreach($booklib->Book as $book) { echo $book['ISBN'] . "\n"; echo $book['title'] . "\n"; echo $book[author] . "\n\n"; }

15.2.3. Common SimpleXML Class Method: Method addChild()

Description Adds a child element to the XML node. Ex: $magazine = $booklib->addChild('magazine'); $magazine->addChild('PCW', 'Mag for IT, Jun 09');

addAttribute()

Adds an attribute to the SimpleXML element. Ex: $magazine->addAttribute('size', 'big');

attributes()

Returns element's attributes. Ex: foreach($magazine->attributes() as $magAttr)

children()

Finds children of given node. Ex: foreach($booklib->children() as $book)

getName()

Gets the name of the XML element. Ex: $tagName = $magazine->getName();

xpath()

Runs XPath query on XML data. Ex: $result =$booklib->xpath('/Books/Book/author');

15.2.4. Export XML Data: - Output to XML string: header('Content-type: text/xml'); echo $booklib->asXML();

- Save to XML file: $booklib->asXML('mybook.xml');

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

183

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

15.3. Web Service Basics: 15.3.1. Introduction: − − − − − −

Web services are application components Web services communicate using open protocols Web services are self-contained and self-describing Web services can be discovered using UDDI Web services can be used by other applications XML is the basis for Web services

15.3.2. Types of Using Web Services: 15.3.2.1. Reusable application-components: - Reusable components. - Offer application-components. - Examples: Weather report, Map… 15.3.2.2. Connect existing software: - Solve interoperability problem. - Link to exchange data between different applications and platforms.

15.4. SOAP: 15.4.1. Enable SOAP Extension in PHP5: - Edit file PHP.INI, uncomment line extension for php_soap

15.4.2. Using non-WSDL Mode: 15.4.2.1. Soap Server: class QuoteService { private $quotes = array("ibm" => 98.42); function getQuote($symbol) { if (isset($this->quotes[$symbol])) VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

184

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477 { return $this->quotes[$symbol]; } else { throw new SoapFault("Server","Unknown Symbol '$symbol'."); } } } $options = array('uri' => 'http://localhost/soap/server.php'); $server = new SoapServer(NULL, $options); $server->setClass("QuoteService"); $server->handle();

15.4.2.2. Soap Client: $options = array( 'location' => http://localhost/soap/server.php', 'uri' => 'http://localhost/soap/'); $client = new SoapClient(NULL, $options); try { print($client->getQuote("ibm")); print($client->getQuote("microsoft")); } catch (SoapFault $exception) { echo 'Not Found'; }

15.4.3. Using WSDL Mode: 15.4.3.1. WSDL File:





15.4.3.2. Soap Server: class QuoteService { private $quotes = array("ibm" => 98.42); function getQuote($symbol) { if (isset($this->quotes[$symbol])) { return $this->quotes[$symbol]; } else { VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

186

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477 throw new SoapFault("Server","Unknown Symbol '$symbol'."); } } } $server = new SoapServer("stockquote.wsdl"); $server->setClass("QuoteService"); $server->handle();

15.4.3.3. Soap Client: $client = new SoapClient("stockquote.wsdl"); try { print($client->getQuote("ibm")); print($client->getQuote("microsoft")); } catch (SoapFault $exception) { echo 'Not Found'; }

15.5. JSON Overview: 15.5.1. Introduction: {"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"} ] } }}

15.5.2. Using JSON in PHP: VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

187

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

15.5.2.1. json_encode() : returns the JSON format of a variable. Ex: $arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5); echo json_encode($arr); // Displays '{"a":1,"b":2,"c":3,"d":4,"e":5}'

15.5.2.2. json_decode() : decodes a JSON string. Ex: $json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; var_dump(json_decode($json)); var_dump(json_decode($json, true)); // Displays object(stdClass)#1 (5) { ["a"] => int(1) ["b"] => int(2) ["c"] => int(3) ["d"] => int(4) ["e"] => int(5) } array(5) { ["a"] => ["b"] => ["c"] => ["d"] => ["e"] => }

int(1) int(2) int(3) int(4) int(5)

15.5.3. XML vs. JSON: XML Format:

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

188

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

Chapter Exercise: A> Write a Webpage simple SOAP service to simulate a calulator with operator: +, -, *, / and write an client using that service. In client side, user input 2 number in HTML form and click submit, your script will use calculator service to calculate the result and response for user. Example: $sum = $client->plus($_GET['first'], $_GET['second']); B> Use SimpleXML to read RSS Feeds from a news website (ex:tuoitre, vnexpress…) and displays into your website.

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

189

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

Chapter 16

Security Keywords: security, hack, attacker, password, register globals, exploit, input, whitelist, blacklist, filtering, sanitize, escape, hashing, spoof, XSS, CSRF, SQL Injection, information leakage, command Injection, user agent, risk, vulnerable, validate, session fixation, hijacking, identifier, privilege, remote code injection, safe mode.

Subjects: 16.1. Security Basics 16.2. Database Security 16.3. Website Security 16.4. Session Security 16.5. File System Security

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

190

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

16.1. Security Basics: 16.1.1. Why consider security? 16.1.2. Core PHP security theory: - know the mechanism of HTTP model - Check PHP configuration - Hide important data - Filter User input data

16.2. Database Security: 16.2.1. SQL Injection:

 Solution: - Prevent unauthorized access VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

191

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- Limit the permissions. - Filter user input - Using prepared statements - Hide database errors.

16.2.2. Information Leakage: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES)' in D:\AppServ\www\phpa\index.php(492) : eval()'d code:1 Stack trace: #0 D:\AppServ\www\phpa\index.php(492) : eval()'d code(1): PDO>__construct('mysql:host=loca...', 'root', 'rooat') #1 D:\AppServ\www\phpa\index.php(492): eval() #2 {main} thrown in D:\AppServ\www\phpa\index.php(492) : eval()'d code on line 1

 Solution: - Configure right setting for logging, display error - Catch exception when error

16.3. Website Security: 16.3.1. Weak Authentication: - Weak Password - Guessing Files & Directories - People

 Solution: - Strong password - Set Access-Rule for files, directories - Publish files/directories when needed. VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

192

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- Notice to file/directory name convention - Keep your secret

16.3.2. Using bad libraries, components, plug-ins: - Open-source projects - Free-proviced scripts, libraries, components, plug-ins, widgets… - Discussion Board (forum…) - "Bad" books - "Bad" people.

 Solution: - Check bugs before using. - Check the source of scripts, libraries, plug-ins, widgets… - Check the reviews of others scripts. - Write your own code when needed.

16.3.3. DoS – DDoS - SPAM:

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

193

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

 Solution: - Using Session to limit the actions on the website - User Authentication - Redirect & Authentication - Track IP - Check User-Agent - Using CAPTCHA - Use lower level system security (Clustering & Load balance, IDS, IPS, Bandwidth management)

16.3.4. Cross Site Scripting - XSS : VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

194

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

View Animation: http://www.virtualforge.de/vmovie.php

 Solution: - Filter All Input - Escape All Output - Only Allow Safe Content

16.3.5. Cross Site Request Forgery – CSRF :

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

195

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

196

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

View Animation: http://www.virtualforge.de/vmovie.php

 Solution: - Use POST methods - Require Verification for important actions - Use an Anti-CSRF Token. - Limit the external link resource(images, scripts…) submitted by users

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

197

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

16.4. Session Security: 16.4.1. Session Fixation:

 Solution: - Correct Configuration (do not accept external SIDs, set time-out..) - Perform session id regeneration, support log-out, reject illegal referrers… Ex: if (strpos($_SERVER['HTTP_REFERER'], 'https://DiD/') !== 0 || isset($_GET['LOGOUT']) || $_SERVER['REMOTE_ADDR'] !== $_SESSION['PREV_REMOTEADDR'] || $_SERVER['HTTP_USER_AGENT'] !== $_SESSION['PREV_USERAGENT']) session_destroy(); session_regenerate_id(); // generate a new session identifier $_SESSION['PREV_USERAGENT'] = $_SERVER['HTTP_USER_AGENT']; $_SESSION['PREV_REMOTEADDR'] = $_SERVER['REMOTE_ADDR']; VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

198

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

16.4.2. Session Hijacking:

 Solution: - Using HTTPS on sensitive areas - Check various request headers sent by the client (User-Agent, IP, referrer header) Ex: // After a successful login, store the User-Agent into the session: $_SESSION['user_agent'] = $_SERVER['HTTP_USER_AGENT']; // On subsequent page loads, check to ensure User-Agent // not change. If its has changed, then that is cause VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

199

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477 // for concern, and the user should log in again if ($_SESSION['user_agent'] != $_SERVER['HTTP_USER_AGENT']) { // Force user to log in again exit; }

16.5. File System Security: 16.5.1. File Including Injection:  Solution: - Check the path of included file - Filter file name

16.5.2. Command Injection:  Solution: - Disable unuse functions using directives in PHP.INI file( directive disable_functions, disable_classes) - Using escape function: escapeshellcmd(), escapeshellarg(). - Avoid the use of shell commands. - Avoid the use of client input to construct dynamic shell commands.

16.5.3. Shared Hosting , Local Attack:  Solution: - Limit the access to your files/directories - Using open_basedir, disable_functions, disable_classes directives in PHP.INI Ex: ; Disable functions disable_functions = exec,passthru,shell_exec,system

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

200

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477 ; Disable classes disable_classes = DirectoryIterator,Directory

Chapter Exercise: A> Check security for all your projects. B> Using CAPTCHA function for register user page in your projects.

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

201

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

Chapter 17

Advanced PHP Topics Keywords: config, section, directive, date, time, email, phpmailer, gd, image, color, curl, smarty, template engine.

Subjects: 17.1. PHP.INI File Overview 17.2. Date & Time 17.3. Email Sending 17.4. Image Processing 17.5. cURL Library 17.6. Smarty 17.7. Different between PHP5 & PHP4 VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

202

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

17.1. PHP.INI File Overview: 17.1.1.Introduction: - is a PHP configuration file, controls some of the settings of the PHP interpreter. - Use this code to view the contents of php.ini

- On Linux, php.ini may be located in: /etc/php.ini /etc/php/php.ini /etc/php5/php.ini /usr/bin/php5/bin/php.ini

- On Windows, php.ini may be located in: C:\WINDOWS\php.ini

17.1.2.Directives: - Directive is a setting for a function/system when running PHP script. - Each directive in php.ini usually has comment. Comment lines begin with comma (,) - You can disable some directives by inserting comma to begin of line, PHP will use the default value for disabled directives. - Format: directive_name = directive_value - Ex: short_open_tag = On post_max_size = 80M

17.1.3. Sections: - Group php.ini directives together. - Format: [SECTION_NAME] VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

203

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- Ex: [PHP] [MySQL] [Session]

17.1.4. Some important directives: - error_reporting, display_errors, register_globals, post_max_size, magic_quotes_gpc, upload_max_filesize, extension

17.2. Date & Time: 17.2.1. Get the current date & time: - The simplest and most basic thing you'll want to do with PHP's date API is, obviously, get the current date and time. This is best accomplished via the getdate() function, which returns an associative array containing date and time information. - Ex: $today = getdate(); print_r($today); // Displays Array ( [seconds] [minutes] [hours] [mday] [wday] [mon] [year] [yday] [weekday] [month] [0] )

=> => => => => => => => => => =>

40 58 21 17 2 6 2003 167 Tuesday June 1055901520

17.2.2. Timestamp Introduction: VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

204

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- Most of PHP's date functions work on the basis of timestamps. This timestamp is a unique numeric representation of a particular date, calculated as the number of seconds between January 1 1970 and the date and time specified, and makes it easier to perform arbitrary calculations on date and time values. - In PHP, UNIX timestamps are created via the mktime() function, which accepts a series of date and time parameters, and converts them into a timestamp - Ex: echo mktime(14, 35, 20, 4, 1, 2002); //displays 1017651920

- You can obtain a timestamp for the current moment in time by calling mktime() with no arguments: - you can also use the time() function, which returns the current timestamp

17.2.3. Format date/time output: - Once you've got yourself a timestamp, you can use the date() function to format it. - This date() function is easily one of the most useful functions in this collection Ex: echo "It is now " . date("h:i d M Y", mktime());

- Common format characters of date() function (view full list at http://php.net/date):

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

205

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

17.3. Email Sending: 17.3.1. Using function mail() from PHP: $to

= '[email protected]'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers);

17.3.2. PHPMailer Class: - Download class at: http://phpmailer.worxware.com/ require("phpmailer/class.phpmailer.php"); //change settings here VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

206

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477 $your_email = "[email protected]"; $your_smtp = "mail.example.com"; $your_smtp_user = "[email protected]"; $your_smtp_pass = "example_password"; $your_website = "http://example.com"; //get contact form details $name = $_POST['name']; $email = $_POST['email']; $url = $_POST['url']; $comments = $_POST['comments']; $response="Name: $name\nContents:\n$comments\n"; $mail = new PHPmailer(); $mail = $mail->SetLanguage("en", "phpmailer/language"); $mail->From = $your_email; $mail->FromName = $your_website; $mail->Host = $your_smtp; $mail->Mailer = "smtp"; $mail->Password = $your_smtp_pass; $mail->Username = $your_smtp_user; $mail->Subject = "$your_website feedback"; $mail->SMTPAuth = "true"; $mail->Body = $response; $mail->AddAddress($your_email,"$your_website admin"); $mail->AddReplyTo($email,$name); echo "Thanks for your feedback"; if (!$mail->Send()) { echo "Send Email Error. Try again later!"; } $mail->ClearAddresses(); $mail->ClearAttachments();

17.4. Image Processing: 17.4.1. GD Library Introduction: - The GD library is used for dynamic image creation. From PHP we use with the GD library to create GIF, PNG or JPG images instantly from our code. This allows us to do things such as create charts on the fly, created an an anti-robot security image, create thumbnail images, or even build images from other images. VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

207

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

17.4.2. Useful Image Functions: Function

Description

imagecreate()

Creates a blank image resource of the specified size. Creates an image resource from the specified GIF format file. Creates an image resource from the specified JPEG format file. Creates an image resource from the specified PNG format file. Returns the image's width Returns the image's height Output a GIF image to browser or file Output a JPEG image to browser or file Output a PNG image to browser or file Destroy an image resource, free up memory Copy part of an image Copy and merge part of an image Copy and resize part of an image with resampling

imagecreatefromgif() imagecreatefromjpeg() imagecreatefrompng() imagesx() imagesy() imagegif() imagejpeg() imagepng() imagedestroy() imagecopy() imagecopymerge() imagecopyresampled()

17.4.3. Example: // File imagethumb.php // Capture GET parameters $source_file = $_GET['image']; $new_width = $_GET['width']; $new_height = $_GET['height']; // Open source image file and get image dimensions $old_image = imagecreatefromjpeg($source_file); $old_width = imagesx($old_image); $old_height = imagesy($old_image); // Create blank image $new_image = imagecreatetruecolor($new_width,$new_height); // Copy and resize old image into new image resource and then return to browser imagecopyresized($new_image,$old_image,0,0,0,0,$ne w_width,$new_height,$old_w idth,$old_height); header('Content-type: image/jpeg'); imagejpeg($new_image);

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

208

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

Called with:

17.5. cURL Library: 17.5.1. cURL Introduction: - The cURL extension to PHP is designed to allow you to use a variety of web resources from within your PHP script - It lets you use several web protocols using one uniform interface, most notably FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, and LDAP. - The basic premise to using Curl is that there are four steps: initialize cURL, set your options, execute your query, and close Curl. - Curl is very configurable, and there are dozens of options you can set to make it do all sorts of things.

17.5.2. Using cURL: $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,"http://example.com/login.php"); curl_setopt($ch, CURLOPT_REFERER, "http://www.google.com/"); curl_setopt($ch, CURLOPT_USERAGENT, "MozillaXYZ/1.0"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "Username=johndoe&Password=1234&Submit=Go%21"); $result = curl_exec ($ch); curl_close($ch);

17.6. Smarty: 17.6.1. Smarty Introduction: VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

209

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- Written in PHP - Is a Template Engine - Many features: . No parsing overhead . Extensible : functions, modifiers… . Control statements . Can embed php code in template . Caching . Output filtering

17.6.2. Using Smarty: - Installation: download at http://www.smarty.net/ - File structure: /www.example.com/smarty/ Smarty.class.php VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

210

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477 Smarty_Compiler.class.php Config_File.class.php debug.tpl internals/*.php plugins/*.php /www.example.com/ smarty/ templates/ templates_c/ configs/ cache/

17.6.3. Example: require 'Smarty.class.php'; $smarty = new Smarty; $smarty->assign('Username', 'John Doe'); $smarty->display('index.tpl');

- index.tpl file Welcome {$Username}

17.7. Different between PHP5 & PHP4: 17.7.1. Language Features: - allows limited type hinting. - foreach support by-reference declaration - A number of new functions, particularly for string and array manipulation

17.7.2. OOP: - all objects are passed by reference VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

211

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- defines constant within the scope of a class - class methods and properties support visibility: public, private, protected - using clone mechanism to copy objects. - using __construct() and __destruct() - interfaces and abstract classes - lazy loading using __autoload()

17.7.3. New Extensions: - SimpleXML, DomXML - PHP Data Object (PDO) - Standard PHP Library(SPL) - Reflection extension

17.7.4. Error Management: - Classes support exceptions - E_STRICT error reporting level : emit notices when legacy or deprecated code is encountered.

Chapter Exercise: Using image functions to enhanced the photo editing page of current project. Ex: resize, crop, create thumbnail, add watermark…

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

212

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

Chapter 18

Design Pattern Keywords: design, singleton, factory, strategy, MVC, Model-ViewController, business logic, presentation, request, response.

Subjects: 18.1. Fundamentals 18.2. Singleton Pattern 18.3. Factory Pattern 18.4. Strategy Pattern 18.5. Model-View-Controller (MVC) Pattern

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

213

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

18.1. Fundamentals: 18.1.1. Design Pattern Theory: - In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. - It is a description or template for how to solve a problem that can be used in many different situations.

18.1.2. Popular Design Patterns: 18.1.2. 1. Creational design patterns: is all about class instantiation. Ex: Abstract Factory, Builder, Factory, Object Pool, Prototype, Singleton… 18.1.2.2. Structural design patterns: about Class and Object composition. Ex: Adapter, Bridge, Composite, Decorator, Façade, Flyweight, Private Class Data, Proxy… 18.1.2.3. Behavioral design patterns: about Class's objects communication. Most specifically concerned with communication between objects. Ex: Chain of responsibility, Command, Interpreter, Iterator, Null Object, Observer, Strategy…

18.2. Singleton Pattern: 18.2.1. Singleton Pattern Introduction:

- Ensure that only one instance of a class is created and provide a global access point to the object. - Singleton pattern should be used when we must ensure that only one instance of a class is created and when the instance must be available through all the code. A special care VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

214

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

should be taken in multithreading environments when multiple threads must access the same resources through the same singleton object. - There are many common situations when singleton pattern is used: - Logger Classes - Configuration Classes - Accessing resources in shared mode

18.2.2. Implement Singleton Pattern in PHP: class Singleton { protected static $_instance; // don't permit an explicit call of constructor! protected function __construct(){ } public static function getInstance() { if( self::$_instance === NULL ) self::$_instance = new self(); return self::$_instance; } }

18.3. Factory Pattern: 18.3.1. Factory Pattern Introduction:

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

215

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- Creates objects without exposing the instantiation logic to the client and refers to the newly created object through a common interface. - Factory pattern should be used when: - a framework delegate the creation of objects derived from a common superclass to the factory - we need flexibility in adding new types of objects that must be created by the class - Along with singleton pattern the factory is one of the most used patterns. Almost any application has some factories.

18.3.2. Implement Factory Pattern in PHP: interface IProduct { function calWeight(); function say(); } class ProductLaptop implements IProduct { function calWeight(){} function say() { echo 'I am a laptop'; } VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

216

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477 } class ProductDesktop implements IProduct { function calWeight(){} function say(){} } class ProductFactory { const PROD_DESK = 1; const PROD_LAP = 2; public static function getProduct($type = self::PROD_LAP) { switch($type) { case self::PROD_DESK : return new ProductDesktop(); break; case self::PROD_LAP : return new ProductLaptop(); break; default: throw new Exception('Not found.'); } } } $obj = ProductFactory::getProduct(ProductFactory::PROD_LAP); $obj->say();

18.4. Strategy Pattern: 18.4.1. Strategy Pattern Introduction:

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

217

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from the clients that use it. - Capture the abstraction in an interface, bury implementation details in derived classes.

18.4.2. Implement Strategy Pattern in PHP: interface IStrategy { function getPoint($point = 0); } class StrategyHappy implements IStrategy { function getPoint($point = 0) { return ++$point; } } class StrategySad implements IStrategy { function getPoint($point = 0) { return --$point; } } class Student { private $point; VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

218

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477 function __construct($point = 0) { $this->point = $point; } function tellPoint($strategy) { $newPoint = $strategy->getPoint($this->point); echo 'My point is ' . $newPoint; } } $studentA = new Student(9); $studentA->tellPoint(new StrategyHappy()); $studentB = new Student(9); $studentB->tellPoint(new StrategySad());

18.5. Model-View-Controller (MVC) Pattern: 18.5.1. MVC Pattern Introduction:

- Model–view–controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic (or other program logic) from the user interface, permitting one to be freely modified without affecting the other. VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

219

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- The Model is how your data is going to be represented. This is usually in the form of a relational database (MySQL). - We use a Controller to interact and query the data within the Model layer. The controller also sends data to the view. Some people refer to the Controller as the business logic within a software system. - The View is a way to represent or serve up the data manipulated by the controller from the model. The view is typically what the end user interacts with, often times in the form of a web page.

18.5.2. MVC Framework Overview:

- Some popular PHP MVC Framework: Framework PHP Multiple DB ORM Ver. CakePHP 4,5 x x CodeIgniter 4,5 x Prado 5 x x Symfony 5 x x Zend 5 x x

Template

Cache

Validation

Ajax

x x x x x

x x x x x

x

x x

x x x

- Multiple DB: Indicates whether the framework supports multiple databases without having to change anything. VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

220

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- ORM: Indicates whether the framework supports an object-record mapper, usually an implementation of ActiveRecord. - Template: Indicates whether the framework has an inbuilt template engine. - Cache: Indicates whether the framework includes a caching object or some way other way of caching. - Validation: Indicates whether the framework has an inbuilt validation or filtering component. - Ajax: Indicates whether the framework comes with inbuilt support for Ajax.

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

221

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

Chapter 19

E-Commerce Website Keywords: ecommerce, shopping cart, payment, order, optimization, search engine, SEO, backend, frontend, web analytic, google.

Subjects: 19.1. E-Commerce Fundamentals 19.2. Website Optimization 19.3. SEO Basics 19.4. Website Analytic – Google Analytic

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

222

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

19.1. E-Commerce Fundamentals: - consists of the buying and selling of products or services over electronic systems such as the Internet and other computer networks. - Features of an ecommerce website: •

Online Shopping Cart



Secure Credit Card Facility (SSL)



Online Payment Option



Offline Payment Options



Payment Gateway Interface



Member Accounts



Subscription Options



Customised Data Collection & Reporting



Multiple Currencies



Automated Electronic Invoice & Receipts System



Freight Management



Order Management



Integration with Inventory Management & Accounting Systems



Integration with Email Marketing Systems

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

223

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

19.2. Website Optimization: 19.2.1. Front-end Optimization:

19.2.2. Back-end Optimization: - Code Optimize VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

224

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

- Query Optimize - Caching

19.3. SEO Basics: 19.3.1. Introduction: - Short for search engine optimization, the process of increasing the amount of visitors to a Web site by ranking high in the search results of a search engine. The higher a Web site ranks in the results of a search, the greater the chance that that site will be visited by a user. It is common practice for Internet users to not click through pages and pages of search results, so where a site ranks in a search is essential for directing more traffic toward the site. - SEO helps to ensure that a site is accessible to a search engine and improves the chances that the site will be found by the search engine.

19.3.2. Some SEO Techniques: 1. The Meta Keywords, Description and Robots tag — Google used description copy to market your site in its results, treat this as optimized sales copy. Make sure your sitemap.xml page is CONSTANTLY called up to the search engines 2. The Title Tag - The MOST important aspect of on-page SEO, just take our word for it. 3. The Body Text (focus on the body text in bold, for this denotes strong emphasis to the search engines) 4. The first sentence in the body text and the first words used per sentence are the most important ones for advanced on-page SEO necessities (Make it humanly readable and SE readable — The words used in the first sentence are most important due to the implementation of Google’s LSI algorithm) 5. The URL — The subdirectory folder and page of content should be SEO’d (i.e. http://domain.com/real-estate/real-estate-marketing-ideas.com would fetch a high ranking for a page dedicated to real estate marketing ideas - especially with many highly authoritative, relevant, deep in-bound links) 6. The H1 and H2 Texts are highly important - Why? They show the search engine the main subjects and Table of Contents for the content to be indexed. Make these keyword friendly and reflective of your page’s title tag. 7. Same Site Link Texts — The links connecting the pages of your site together must have your targeted keyword terms in them as well as all links throughout the site VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

225

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

— even though it seems excessive, having variations to your targetted keywords would also help when linking out to other pages within your site. 8. Same-Site Link URLs — Not only should you be using your keywords to describe pages within your site, those URLs you link to must have SEO URLs ( eg: http://domain.com/your-keyword.html) 9. Outbound Link Text — Resources you link to must be SEO’d - If you are an internet marketing site and are linking to an email marketing company (email marketing software in this instance), you would use “Put your internet marketing on auto-pilot and use the best tool for internet marketers today - internet marketing email software. Then just use other variants to internet marketing. 10. IMG Alt Tags — Your images should be described via ALT Tags with the keywords you are optimizing for - If your image is hosted on your web-host, the file name of the images should also be SEO’d — If you have an image about polar bears have it be polar-bear.jpg in your images folder. 11. Keyword Density — 8% is excellent and doesn’t seem spammy, if you have a 500 word article, then 40 of those words should have variances of the search term you are targeting, if this seems excessive, lower the keyword density down to 5% and you will only need to add 25 variances/instances of your keyword. And that’s just a start… (Keyword prominence is big, but not worth a discussion). 12. Lastly and surprisingly, Your HTML comments should have your SEO terms in them (!!) — As a question to the relevancy this has to your ranking, I am unsure, but most of the large sites have html comments connected to their search terms. If you end up doing an analysis of your on-page content, you can find out if the high ranked sites for your keyword use HTML comments tagged to the keyword(s) being targeted.

19.4. Website Analytic – Google Analytic: - Google Analytics is one of the best tools out there for analyzing traffic on your website.

19.4.1. Setup Account: 1. Go to Google Analytics. 2. If you do not have a Google account, click Sign Up Now, to the left of the sign-in box. This will take you to a page where you can sign up for a Google account.

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

226

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

3. If you have a Google account, use your email address and password to sign in. 4. Click the Sign Up button to continue.

5. In the next window, provide Google with the URL of the site you wish to analyze.

6. Give the site an account name that is easy to remember. If you will be tracking multiple sites, this is especially important. 7. Select the country your site is based in, or the country it is serving. Then select the appropriate time zone. o

If your site is based in India but all your users are in the U.S., you may want to select a U.S. time zone to figure out when in their day most choose to use your

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

227

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

site - or you may want to set it to your city's time zone to see when you need the most workers on staff. 8. Click Continue. 9. In the next window, provide your contact information. 10. Click Continue. 11. In the next window, read the Google Analytics terms of service. If you agree with them, click the Yes box. 12. Click Create New Account. 13. Google will provide you with a block of code. Copy this - you'll need to insert it into your web site.

19.4.2. Embed Google Analytics JavaScript Into Pages 1. Find the tag at the very bottom, just above the page. 2. Do you see the code urchinTracker(), utmLinker(), utmSetTrans(), or utmLinkPost() above the tag? If so, you must paste the Google Analytics Javascript above that code. If not, paste it immediately above the tag. 3. If you have templates, insert the code into them as well. 4. Once you have uploaded the pages back to your site, you can begin tracking information!

19.4.3. WebSite Analytic VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

228

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

1. Log in to Google Analytics. 2. In the center of the page is a section titled Website Profiles. Click on the View Reports link to the right of the name of the site you're interested in. This will bring you to the Dashboard.

3. At the top of the page is a chart that gives a visual representation of your site traffic over the past month. o

This chart will only give you data from the time you inserted the tracking code into your pages.

o

If you want to change the span of time the chart displays, click on the dates in the upper right-hand corner. Click on dates in the calendar that is revealed or manually type in dates to view a different span of time.

o

To compare traffic over two different time periods, select one date range you want to use, click Compare to Past, and select the range you wish to compare it against.

o

Just below the dates is a menu that says Visits. Click on it to change the graph to pageviews (how many times the pages on your site have been viewed), pages per visit (how many pages on your site users visited on average), average time on site (how long each user spent on your site), bounce rate (what percentage of VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

229

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

users left after visiting only one page), or percentage of new visits (how many visitors had never been to your site before).

4. Immediately beneath that chart, you'll see a header that says Site Usage, with six small charts underneath. Under Site Usage, you'll find quick information on various site traffic statistics for the time period shown in the main chart. Each one has an individual chart. o

Visits tells you how many visits there were to your page. A visit is defined as a page view when that user has viewed no other page on your site in the past half hour.

o

Pageviews tells how many times the pages on your site have been viewed.

o

Pages/visit tells how many pages, on average, users view when they come to your site.

o

Bounce Rate tells what percentage of users left after viewing only one page on your site.

o

Avg. Time on Site shows how long each user spent on your site.

o

New Visits shows what percentage of your users have not visited your site before.

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

230

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

231

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

5. The Visitors Overview graph shows how many visitors have come to your site. o

This number is usually lower than the Visits statistic, sometimes a lot lower, because some visitors may visit your site over and over again.

o

Click on View Report to view more detailed information about your visitors.

6. "Map Overlay" displays what countries your visitors are coming from. o

The darker the green, the more visitors come from that country.

o

Click View Report to get in-depth information on where your visitors come from.

7. Traffic Sources Overview shows which percentage of users are getting to your site by typing your URL directly into their browser, and via search engines, referring sites, and other avenues such as emailed links. o

Click on View Report to get breakdowns of exactly what places your users are coming from, and what keywords they're looking for.

8. Content Overview specifies the top five most viewed pages over the time period you're looking at. o

Click on the name of any page to get extremely detailed information about where the people viewing that page came from, how long they spent on the page, how many of them were new to the page, and a lot more.

o

Click on View Report to get access to information about the performance of all pages on the site.

19.4.4. See How Website Site Is Performing Daily and Hourly 1. In the menu to the left, click on the word Visitors.

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

232

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

2. To the left beneath the main chart, you'll see a number of different statistical breakouts.

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

233

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

3. Click on any of the words to get a bar-chart breakout of the daily performance for that aspect of site traffic measurement. 4. If you want to learn hour-by-hour trends, click on the word Hourly above the bar chart to see an hour by hour graph for the time period at hand. 5. To compare two different time periods, click on the dates above the line graph. Select the first set of dates you want to work with, check the Compare to Past box, click on the second set of dates, and click the Apply Range button.

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

234

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

19.4.5. See Where Your Traffic Comes From 1. In the lower right-hand corner of the Dashboard you'll find your site's top 5 mostaccessed pages. Click on any of these.

2. Below the chart on the right hand side, you will see a heading labeled Landing Page Optimization. Click on the link beneath it labeled Entrance Sources.

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

235

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

3. Beneath the chart, you'll see a table. This table lists all the places your users came from to visit your site.

o

In the first column to the right of the source name is the number of pageviews your page received from that source.

o

The next column tells how many of those were unique pageviews - someone coming to your page who had not been to that page before in the time frame you're reviewing.

o

Time on Page tells you how much time, on average, users from that particular source spent on the page in question.

o

Bounce Rate shows how many people from that specific source left your site after looking at that page, without viewing another page.

o

% Exit shows how many people from that specific source went to another site from that page. (This number may be lower than the Bounce Rate number; if they close the window or shut down their browser, it is not considered exiting.)

o

When you set up certain financial measurements in the Goals section, Google will crunch the numbers to show you how much return you're getting with the $ Index column. VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

236

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

4. If you want to get information on other pages, under the Content menu on the right, click on the Content by Title menu item. You can now go through all of your content to learn information on every page! 5. Return to the main dashboard by clicking on the word Dashboard in the upper-left corner. Course Project: Write a complete e-commerce website with: Function requirement: 1. Support Shopping cart 2. Email ordering 3. Have Administration Control Panel 4. Have User registration/login/forgot password function 5. User can manage orders if logins, purchases products and checks out. 6. Security website 7. SEO Coding requirement: 1. Using MVC Framework (OOP) 2. Using PDO 3. Using Smarty

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

237

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

Chapter 20

Zend PHP 5 Certification - ZCE Keywords: zce, zend, test, vulcan, mock test, exam, engineer, certification, certified, Pearson Vue, Yellow page.

Subjects: 20.1. Zend Certification Introduction 20.2. Zend PHP 5 Certification Exam

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

238

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

20.1. Zend Certification Introduction: 20.1.1. Zend Certification Type: - Zend PHP 5 Certification - Zend Framework Certification

20.1.2. PHP Yellow Pages:

20.1.3. Zend Certificate

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

239

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

ZCE Logo

20.2. Zend PHP 5 Certification Exam: 20.2.1. PHP Exam Contents:

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

240

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

20.2.2. Exam Information : - Tesing Center: Pearson VUE - Price: $125 - 70 questions with 3 types: − A multiple-choice question with only one right answer. VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

241

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

− A multiple-choice question with multiple correct answers. − A free-form question for which the answer must be typed in. - Test duration: 90 minutes

20.2.3. Exam Practice Resources : - PHP Manual - Books - Mock Test

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

242

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

Good luck!

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

243

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

Further Reading: 1. Core PHP programming, 3rd Edition (Prentice Hall 2003) – Leon Atkinson, Zeev Suraski 2. PHP 5 for Dummies (For Dummies 2004) - Janet Valade. 3. Object-Oriented Programming with PHP5 (Packt Publishing 2007) - Hasin Hayder. 4. Beginning PHP 5 and MySQL E-Commerce : From Novice to Professional (Apress 2004) - Cristian Darie, Mihai Bucica. 5. Professional PHP 6 (Wrox 2009) - Ed Lecky Thompson, Steven D. Nowicky, Thomas Myer. 6. Advanced PHP Programming (Sams 2004) - George Schlossnagle. 7. Learning PHP Data Objects (Packt Publishing 2007) - Dennis Popel. 8. Smarty PHP Template Programming and Application (Packt Publishing 2006) - Joao Prado Maia, Hasin Hayder, Lucian Gheorghe. 9. Head First Design Patterns (O'Reilly 2009) - Elisabeth Freeman, Eric Freeman, Bert Bates, Kathy Sierra. 10. Php|architect's Guide to PHP Design Patterns (php|architech 2005) - Jason E. Sweat. 11. MySQL, 4th Edition (Addison Wesley 2008) - Paul Dubois. 12. Professional Web 2.0 Programming (Wiley Publishing 2007) - Eric van der Vlist, Alessandro Vernet, Erik Bruchez, Joe Fawcett, Danny Ayers. 13. The Essential Guide to CSS and HTML Web Design (friends of ED 2007) – Craig Grannell 14. Pro CSS Techniques (Apress 2006) - Jeff Croft, Ian Lloyd, Dan Rubin. 15. Javascript Bible, 6th Edition (Wiley Publishing 2007) – Danny Goodman, Michael Morrison 16. Learning jQuery (Packt Publishing 2007) - Jonathan Chaffer, Karl Swedberg. 17. Search Engine Optimization : An Hour a Day (Wiley Publishing 2006) - Jennifer Grappone, Gradiva Couzin. 18. Head First Software Development (O'Reilly 2008) - Dan Pilone, Russ Miles. VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

244

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

19. How to Break Web Software (Addison-Wesley Professional 2006) - Mike Andrews, James A. Whittaker. 20. HTTP Essential Protocols for Secure, Scaleable Web Sites (John Wiley & Sons 2001) Stephen A. Thomas.

Useful Websites: 1. http://php.net/ 2. http://talks.php.net/ 3. http://zend.com/ 4. http://www.smarty.net/ 5. http://www.phpdeveloper.org/ 6. http://www.phpclasses.org/ 7. http://phpbuilder.com/ 8. http://mysql.com/ 9. http://www.w3schools.com/ 10. http://developer.yahoo.com/ 11. http://www.google.com/webmasters/ 12. http://www.seomoz.org/ 13. http://www.smashingmagazine.com/ 14. http://templatemonster.com/ 15. http://jquery.com/ 16. http://www.alistapart.com/ 17. http://www.cssplay.co.uk/ 18. http://knowfree.net/ 19. http://ha.ckers.org/ 20. http://www.riapedia.com/ VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

245

THÀNH VIÊN HIỆP HỘI AN TOÀN THÔNG TIN VIỆT NAM- VNISA

WWW.ATHENA.EDU.VN . TEL: 1900 54 54 56 -090 7879 477

Textbook Author: Full Name: Vo Duy Tuan Email: [email protected] Phone: 0938 916 902 Website: http://bloghoctap.com/

VO DUY TUAN

PHP Beginner & Intermediate ATHENA INFORMATION TRAINING

246

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF