"PHP 5.5 from scratch (video tutorial)" Dangdang Purchase Address:
Http://product.dangdang.com/23586810.html
"PHP 5.5 from scratch (video tutorial)" Source code, teaching video download Address:
Http://pan.baidu.com/s/1zt9hW
Content Introduction
This book introduces the main knowledge and skills of PHP 5.5 to develop dynamic Web site, and provides a large number of PHP application examples for the reader to practice. Each chapter clearly describes the role of code and its writing ideas, so that readers can quickly grasp the shortest possible time in PHP application development skills.
A total of 22 chapters, the basic concept of PHP 5.5, the PHP server environment configuration, PHP basic syntax, PHP language structure, string and regular expressions, arrays, time and date, object-oriented, error handling and exception handling, PHP and Web page interaction, file and directory operations, Graphic image processing, cookie session management, MySQL database Foundation, PHP operation MySQL database, PDO database abstract class library, PHP and JavaScript comprehensive application, PHP and XML technology integrated application, PHP and AJAX integrated Application, Smarty template, Zend framework, etc., finally through a php+mysql database of comprehensive cases, so that readers further consolidate the knowledge learned, improve the comprehensive combat ability.
This book is suitable for beginners of PHP, as well as the majority of Web site developers, but also for colleges and universities and training schools related professional teachers and students reference.
Directory
The 1th chapter of the first knowledge of PHP. 1
1.1 PHP in the ins and outs ... 1
1.1.1 PHP Concept ... 1
1.1.2 PHP Development process ... 1
1.1.3 The advantages of PHP language ... 2
1.2 What PHP can do ... 2
1.3 New features of PHP 5.5 ... 3
1.4 PHP common Development tools ... 5
1.4.1 PHP code Development tools ... 5
1.4.2 Web Design Tools ... 6
1.4.3 Text Editing tools ... 6
1.5 Troubleshooting ... 7
2nd. PHP 5.5 Server Environment configuration ... 8
2.1 PHP Server Overview ... 8
2.2 Pre-installation PHP5.5 preparation work ... 9
2.2.1 Hardware and Software environment ... 9
2.2.2 Get PHP5.5 Install Resource pack ... 9
2.3 PHP 5.5+iis Server Installation configuration ... 11
2.3.1 IIS introduction and its installation ... 11
2.3.2 PHP installation ... 12
2.3.3 Settings for virtual directories ... 15
2.4 PHP 5.5+apache Server environment to build ... 16
2.4.1 Apache Introduction ... 16
2.4.2 Close the original Web server ... 17
2.4.3 install Apache. 17
2.4.4 to associate PHP with Apache ... 19
2.5 Practical exercises?? My first PHP program ... 20
2.6 Troubleshooting ... 21st
The 3rd chapter of PHP 5.5 basic syntax ... 23
3.1 PHP identifiers ... 23
3.1.1 Short Style ... 23
3.1.2 Script Style ... 23
3.1.3 ASP Style ... 24
3.2 Coding Specifications ... 24
3.2.1 What is the coding specification ... 24
3.2.2 Coding Specifications in PHP ... 24
3.3 Constants ... 25
3.3.1 declaring and using constants ... 25
3.3.2 built-in constants ... 26
3.4 Variables ... 28
3.4.1 variable declaration in PHP ... 28
3.4.2 variable variable and variable reference ... 28
3.4.3 variable scope (variablescope) ... 30
3.5 Data Type ... 33
3.5.1 What is a type ... 34
3.5.2 integral type (integer) ... 34
3.5.3 floating point type (float or double) ... 34
3.5.4 Boolean Type (Boolean) ... 35
3.5.5 String Type (String) ... 35
3.5.6 Arrays (Array) ... 36
3.5.7 Object Type ... 38
3.5.8 NULL Type ... 38
3.5.9 resource Type (Resource) ... 39
3.5.10 conversion between data types ... 39
3.6 operator ... 40
3.6.1 arithmetic operator ... 40
3.6.2 string operator ... 42
3.6.3 Assignment operator ... 42
3.6.4 comparison operators ... 43
3.6.5 logical operator ... 44
3.6.6 bitwise operator ... 44
3.6.7 Negation control operator ... 45
3.6.8 Error control operator ... 45
3.6.93-dollar operator ... 45
3.6.10 operator precedence and binding rules ... 45
3.7-expression ... 45
3.8 Practical exercises?? Create multi-dimensional arrays ... 46
3.9 Troubleshooting ... 47
The 4th Chapter PHP language Structure ... 48
4.1 Functions ... 48
4.1.1 PHP Function ... 48
4.1.2 customizing and calling Functions ... 48
4.1.3 passing parameter values to a function ... 49
4.1.4 passing a parameter reference to a function ... 50
4.1.5 return a value from a function ... 51
4.1.6 a reference to a function ... 52
4.1.7 the function dereference ... 53
4.2 Process Control Overview ... 53
4.3-Piece control structure ... 54
4.3.1 single conditional branching structure (if statement) ... 54
4.3.2 Bidirectional conditional branching structure (if...else statement) ... 55
4.3.3 multi-direction conditional branching structure (ElseIf statement) ... 56
4.3.4 multi-direction conditional branching structure (switch statement) ... 58
4.4 Loop Control Structure ... 59
4.4.1 While loop statement ... 59
4.4.2 Do...while Loop statement ... 61
4.4.3 for Loop statement ... 62
4.4.4 foreach Loop statement ... 63
Another writing format for 4.4.5 Process Control ... 64
4.4.6 use Break/continue statement to jump out of the loop ... 66
4.5 Combat drills 1?? Conditional branching structure Comprehensive application ... 67
4.6 Combat drills 2?? Comprehensive application of cyclic control structures ... 68
4.7 Troubleshooting ... 69
5th chapter string and regular Expression ... 71
5.1 Single and double quotes for strings ... 71
5.2 String of connectors ... 73
5.3 Basic manipulation of strings ... 74
5.3.1 manually and automatically escapes characters in a string ... 74
5.3.2 calculate the length of the string ... 74
5.3.3 String Word Statistics ... 75
5.3.4 clean space in string ... 76
5.3.5 string segmentation and Grouping ... 77
Intercept of 5.3.6 string substring ... 78
5.3.7 String substring substitution ... 79
5.3.8 String Lookup ... 79
5.4 What is a regular expression ... 80
5.5 Regular expression Syntax rules ... 81
5.6 Practical exercises?? Create a hotel system online booking form ... 85
5.7 Troubleshooting ... 88
6th PHP Array ... 90
6.1 What is an array ... 90
6.2 Type of array ... 90
6.2.1 Numeric Index array ... 91
6.2.2 Associative index array ... 92
6.3 Array Construction ... 93
6.3.11-D Array ... 93
6.3.2 multi-dimensional array ... 93
6.4 Traversal Array ... 95
6.4.1 traversing a one-dimensional numeric index array ... 95
6.4.2 Traversal One-dimensional Union index array ... 96
6.4.3 traversing multidimensional arrays ... 97
6.5 Array sorting ... 99
6.5.11-D Array sorting ... 99
6.5.2 multi-dimensional array sorting ... 100
6.6 Conversion of strings to arrays ... 102
6.7 Adding and removing elements to an array ... 103
6.7.1 adding elements to the array ... 103
6.7.2 removing elements from an array ... 104
6.8 The specified element in the query array ... 106
6.9 count the number of array elements ... 107
6.10 Delete duplicate elements in an array ... 110
6.11 swapping key values and element values in the array ... 110
6.12 Practical exercises?? Serialization of arrays ... 111
6.13 Troubleshooting ... 112
The 7th Chapter time and date ... 113
7.1 System time zone settings ... 113
7.1.1 time Zone Division ... 113
7.1.2 Time zone Settings ... 113
7.2 PHP date and time functions ... 114
7.2.1 about Unix timestamps ... 114
7.2.2 Get current timestamp ... 114
7.2.3 get the current date and time ... 115
7.2.4 using timestamps to get date information ... 116
Validity of 7.2.5 test date ... 119
7.2.6 date and time when the output format timestamp ... 119
7.2.7 Displays the localized date and time ... 121
7.2.8 date and time resolved to UNIX timestamp ... 122
7.2.9 the conversion between the date and time in PHP and MySQL data format ... 123
7.3 Combat drills 1?? Compare the size of two times ... 123
7.4 Combat drills 2?? Implementation Countdown Function ... 124
7.5 Troubleshooting ... 125
The 8th Chapter Object-Oriented Programming ... 126
8.1 Introduction to classes and objects ... 126
8.2 The operation of classes in PHP ... 127
Declaration of the 8.2.1 class ... 127
8.2.2 member Properties ... 128
8.2.3 Member Method ... 128
Instantiation of the 8.2.4 class ... 128
8.2.5 accessing member properties and methods in a class ... 129
8.3 Construction methods and destructor methods ... 131
8.4 Access Methods ... 133
Inheritance of Class 8.5 ... 135
8.6 Abstract classes and interfaces ... 136
8.6.1 Abstract class ... 136
8.6.2 interface ... 137
8.7 Object-oriented polymorphism ... 141
8.7.1 through inheritance to achieve polymorphism ... 141
8.7.2 through the interface to achieve polymorphism ... 143
8.8 Troubleshooting ... 144
9th. Error handling and exception handling ... 146
9.1 Common Errors and exceptions ... 146
9.2 Error Handling ... 149
Error handling mechanism in 9.2.1 php.ini ... 149
9.2.2 applying die statement debugging ... 150
9.2.3 custom errors and error triggers ... 151
9.2.4 Error Logging ... 155
9.3 Exception Handling ... 156
Basic processing method of 9.3.1 anomaly ... 156
9.3.2 The custom exception handler ... 158
9.3.3 Handling Multiple Exceptions ... 160
9.3.4 setting the top-level exception handler ... 162
9.4 Practical exercises?? Handling Exceptions or errors ... 163
9.5 Troubleshooting ... 164
The 10th chapter is the interaction between PHP and Web pages ... 166
10.1 Using dynamic content ... 166
10.2 Forms and PHP. 167
10.3 Form Design ... 167
10.3.1 Form Basic Structure ... 168
10.3.2 text Box ... 168
10.3.3 Options Box ... 169
10.3.4 radio Button ... 170
10.3.5 drop-down list ... 172
10.3.6 reset Button ... 173
10.3.7 Submit Button ... 174
10.4 Two ways to pass data ... 176
10.4.1 passing data by post ... 176
10.4.2 to pass data in a get way ... 177
10.5 php Get form to pass data ... 178
10.6 php to encode URL-passed parameters ... 178
10.7 Practical exercises?? Comprehensive application of PHP and Web Forms ... 179
10.8 Troubleshooting ... 181
11th. php file and directory operations ... 182
11.1 File Operation ... 182
11.1.1 File Data Write ... 182
11.1.2 file Data Read ... 185
11.2 Directory Operation ... 187
11.3 Uploading of files ... 192
11.4 Practical exercises?? Writing a text type of Guest calculator ... 194
11.5 Troubleshooting ... 195
The 12th chapter graphic image processing ... 196
12.1 Loading GD library in PHP ... 196
12.2 Typical application cases of graphic images ... 198
12.2.1 create a simple image ... 198
12.2.2 Use the GD2 function to add text to a photo ... 200
12.2.3 using TrueType fonts to process Chinese-generated images ... 201
12.3 Use of Jpgraph Library ... 203
Installation of 12.3.1 jpgraph ... 203
12.3.2 jpgraph configuration ... 204
12.3.3 making column chart and line chart statistics chart ... 204
12.3.4 Making circular charts ... 206
12.4 Practical exercises?? Make 3D pie chart ... 208
12.5 Troubleshooting ... 209
13th. Cookie and Session Management ... 210
13.1 Cookie Basic Operation ... 210
13.1.1 what is a cookie. 210
13.1.2 Create a cookie. 211
13.1.3 Read cookies. 211
13.1.4 Delete Cookies. 212
13.2 know the session. 214
13.2.1 what is a session. 214
Basic function of 13.2.2 session ... 214
13.2.3 Cookie and session. 214
13.2.4 store SessionID in a cookie or URL. 215
13.3 Session Management ... 215
13.3.1 Create Session ... 215
13.3.2 Register Session variable ... 216
13.3.3 using Session Variables ... 216
13.3.4 Log off and destroy session variables ... 217
13.4 Practical exercises?? Comprehensive application of Session management ... 218
13.5 Troubleshooting ... 219
14th MySQL Database Foundation ... 221
14.1 What is MySQL. 221
14.1.1 client-Server software ... 221
14.1.2 MySQL version ... 222
14.1.3 MySQL Advantage ... 222
14.2 Start the service and log in to the MySQL database ... 223
14.2.1 Start MySQL service ... 223
14.2.2 log in to MySQL database ... 225
14.2.3 Configuring the PATH variable ... 226
14.3 Basic operation of MySQL database ... 228
14.3.1 CREATE Database ... 228
14.3.2 View Database ... 228
14.3.3 Delete Database ... 229
14.3.4 Select Database ... 229
14.4 MySQL Data Sheet basic operation ... 229
14.4.1 Create data Table ... 230
14.4.2 View data table structure ... 231
14.4.3 Modify data table structure ... 233
14.4.4 Delete data Table ... 233
14.5 The operation of the MySQL statement ................................................................................................................. 234
14.5.1 Insert Record ... 234
14.5.2 Query Record ... 234
14.5.3 Modify Record ... 235
14.5.4 Delete Record ... 235
14.6 MySQL database backup and restore ... 236
14.6.1 Data Backup ... 236
14.6.2 Data Restore ... 243
14.7 Troubleshooting ... 245
The 15th chapter PHP operation MySQL Database ... 246
15.1 PHP general steps to access MySQL database ... 246
15.2 Preparation before connecting to the database ... 246
15.3 php operation MySQL database function ... 247
15.3.1 access MySQL database via Mysqli class library ... 247
15.3.2 using the Mysqli_connect () function to connect to the MySQL server ... 249
15.3.3 using the mysqli_select_db () function to select the database file ... 250
15.3.4 using the Mysqli_query () function to execute the SQL statement ... 250
15.3.5 Use the MYSQLI_FETCH_ASSOC () function to get information from the array result set ... 251
15.3.6 uses the Mysqli_fetch_object () function to get a row from the result as an object ... 251
15.3.7 using the Mysqli_num_rows () function to get the number of records in the query result set ... 251
15.3.8 Use the Mysqli_free_result () function to free resources ... 251
15.3.9 Use the Mysqli_close () function to close the connection ... 252
15.4 Combat drills 1?? Add user information dynamically using INSERT statements ... 252
15.5 Combat drills 2?? Querying data information with the SELECT statement ... 254
15.6 Troubleshooting ... 256
16th. PDO database abstract class Library ... 257
16.1 PDO Overview ... 257
Installation of 16.2 PDO ... 258
16.3 Use PDO to operate MySQL. 258
16.3.1 How to connect MySQL database ... 259
16.3.2 Trycatch error handling structure when using PDO ... 259
16.3.3 using PDO to execute SQL selection statement ... 261
16.3.4 use PDO to get the class method of returning data ... 262
16.3.5 using PDO to execute SQL Add, modify statement ... 264
16.3.6 DELETE statement using PDO to execute SQL ... 265
16.4 practical exercises?? The prepare expression of PDO ... 266
16.5 troubleshooting ... 267
17th Chapter JavaScript Programming Basics ... 269
17.1 Meet JavaScript269
17.1.1 What is JavaScript269
17.1.2 JavaScript features ... 270
17.2 JavaScript is used in HTML ... 271
17.2.1 embed JavaScript code in HTML page header ... 271
17.2.2 embed JavaScript code in HTML pages ... 272
17.2.3 embed JavaScript code in an element event of an HTML page ... 273
17.2.4 calls existing JavaScript files in HTML ... 274
17.2.5 introduces JavaScript script code via javascript pseudo-url ... 275
Basic syntax for 17.3 JavaScript ... 276
17.3.1 Execution Order ... 276
17.3.2 Case-sensitive ... 276
17.3.3 semicolons with spaces ... 277
17.3.4 lines of code to be broken ... 277
17.3.5 comments ... 277
17.4 JavaScript data Structure ... 279
17.4.1 identifier ... 279
17.4.2 keywords ... 280
17.4.3 reserved word ... 280
17.4.4 constant ... 281
17.4.5 variable ... 281
17.5 data types in code ... 283
17.5.1 typeof operator ... 283
17.5.2 undefined Type ... 285
17.5.3 NULL Type ... 285
17.5.4 Boolean Type ... 286
17.5.5 Number Type ... 287
17.5.6 String Type ... 288
17.6 article judgment statement ... 288
17.6.1 If statement ... 288
17.6.2 If...else Statement ... 290
17.6.3 Switch statement ... 291
17.7 loop control statement ... 293
17.7.1 While statement ... 293
17.7.2 do...while Statement ... 294
17.7.3 for Loop ... 295
17.8 calling JavaScript code in PHP ... 296
17.8.1 Verify that the value of the form element is empty ... 296
17.8.2 for real-time verification results ... 297
17.9 practical exercises?? Make a tree menu ... 299
17.10 Troubleshooting ... 305
The 18th chapter PHP and XML technology ... 307
18.1 XML Concept ... 307
18.2 XML Syntax Basics ... 309
18.2.1 the composition and declaration of XML documents ... 309
18.2.2 XML element Introduction ... 310
18.2.3 (processing instruction) entity reference ... 313
18.2.4 XML Namespace ... 313
18.2.5 XML DTD: 314
18.2.6 Using CDATA Tags ... 315
18.3 Convert an XML document to HTML to output ... 315
18.4 Creating an XML document in PHP ... 316
18.5 using SimpleXML extensions ... 317
18.5.1 Create SimpleXMLElement Object ... 317
18.5.2 access to specific node elements and attributes ... 318
18.5.3 adding XML elements and attributes ... 319
18.6 Practical exercises?? Creating XML documents dynamically ... 320
18.7 Troubleshooting ... 321
The 19th chapter of the Comprehensive application of PHP and Ajax ... 322
19.1 Ajax Overview ... 322
19.1.1 what is Ajax. 322
19.1.2 key elements of Ajax ... 325
19.1.3 CSS with Ajax. 326
19.2 Ajax Quick Start ... 327
19.2.1 Comprehensive Anatomy of XMLHttpRequest objects ... 327
19.2.2 make an AJAX request ... 329
19.2.3 Processing Server response ... 330
19.3 applying AJAX technology in PHP ... 332
19.4 Troubleshooting ... 337
20th Chapter Smarty Template ... 338
20.1 MVC Overview ... 338
20.2 What is a template engine ... 339
20.3 Smarty Overview ... 339
20.3.1 what is smarty. 340
20.3.2 Smarty and MVC. 340
20.4 Smarty Installation and configuration ... 341
20.4.1 smarty Download and install ... 341
20.4.2 First Smarty Program ... 341
20.5 smarty Template Design ... 342
20.5.1 smarty Template file ... 342
20.5.2 Smarty Logo (tags) ... 343
20.5.3 smarty Variable ... 344
20.5.4 smarty Array ... 345
20.5.5 Smarty in the Process Control statement ... 346
20.6 Troubleshooting ... 348
21st Chapter Zend Framework Frame ... 349
21.1 What is the Zendframework framework ... 349
21.2 Zendframework directory Structure ... 349
Installation and testing of 21.3 zendframework ... 350
21.3.1 Zend Framework installation ... 350
21.3.2 Create a new Zendframework app ... 351
21.4 PHP and zendframework basic operation ... 353
21.4.1 Creating a control layer file in the Zendframework application ... 353
21.4.2 adds an action to the Zendframework control layer file. 354
21.4.3 creating layouts in zendframework ... 355
21.4.4 database operations in Zendframework ... 356
21.4.5 creating forms in Zendframework ... 357
21.5 Expert doubts ... 359
22nd Chapter PHP+MYSQL Development Forum Actual combat ... 360
22.1 website Demand Analysis ... 360
22.1.1 Demand Analysis ... 360
22.1.2 website function Module Analysis ... 360
22.2 Database Analysis ... 361
22.2.1 Analysis Database ... 361
22.2.2 Create data Table ... 361
22.3 Forum Code Implementation ... 362
22.3.1 database connection related files ... 362
22.3.2 Forum Homepage ... 368
22.3.3 New User Registration page ... 372
22.3.4 forum posts related pages ... 374
22.3.5 Background Management system related pages ... 383