Log In
Or create an account -> 
Imperial Library
  • Home
  • About
  • News
  • Upload
  • Forum
  • Help
  • Login/SignUp

Index
Learning PHP, MySQL, JavaScript, and CSS, 2E Dedication Preface
Audience Assumptions This Book Makes Organization of This Book Supporting Books Conventions Used in This Book Using Code Examples Safari® Books Online How to Contact Us Acknowledgments Content Updates
April 12, 2013
1. Introduction to Dynamic Web Content
HTTP and HTML: Berners-Lee’s Basics
The Request/Response Procedure
The Benefits of PHP, MySQL, JavaScript, and CSS
Using PHP Using MySQL Using JavaScript Using CSS
The Apache Web Server About Open Source Bringing It All Together Test Your Knowledge
2. Setting Up a Development Server
What Is a WAMP, MAMP, or LAMP? Installing a WAMP on Windows
Testing the Installation Alternative WAMPs
Installing a MAMP on Mac OS X
Configuring MySQL
Ensuring MySQL starts on booting
Testing the Installation
Installing a LAMP on Linux Working Remotely
Logging In Using FTP
Using a Program Editor Using an IDE Questions
3. Introduction to PHP
Incorporating PHP Within HTML
Calling the PHP Parser
This Book’s Examples The Structure of PHP
Using Comments Basic Syntax
Semicolons The $ symbol
Understanding Variables
String variables Numeric variables Arrays Two-dimensional arrays Variable naming rules
Operators
Arithmetic operators Assignment operators Comparison operators Logical operators
Variable Assignment
Variable incrementing and decrementing String concatenation String types Escaping characters
Multiple-Line Commands Variable Typing Constants
Predefined constants
The Difference Between the echo and print Commands Functions Variable Scope
Local variables Global variables Static variables Superglobal variables Superglobals and security
Test Your Knowledge
4. Expressions and Control Flow in PHP
Expressions
Literals and Variables
Operators
Operator Precedence Associativity Relational Operators
Equality operators Comparison operators Logical operators
Conditionals
The if Statement The else Statement The elseif Statement The switch Statement
Breaking out Default action Alternative syntax
The ? Operator
Looping
while Loops do…while Loops for Loops Breaking Out of a Loop The continue Statement
Implicit and Explicit Casting PHP Dynamic Linking
Dynamic Linking in Action
Test Your Knowledge
5. PHP Functions and Objects
PHP Functions
Defining a Function Returning a Value Returning an Array Passing by Reference Returning Global Variables Recap of Variable Scope
Including and Requiring Files
The include Statement Using include_once Using require and require_once
PHP Version Compatibility PHP Objects
Terminology Declaring a Class Creating an Object Accessing Objects
Cloning objects
Constructors
PHP 5 destructors
Writing Methods
Static methods in PHP 5
Declaring Properties Declaring Constants Property and Method Scope in PHP 5
Static properties and methods
Inheritance
The parent operator Subclass constructors Final methods
Test Your Knowledge
6. PHP Arrays
Basic Access
Numerically Indexed Arrays Associative Arrays Assignment Using the array Keyword
The foreach...as Loop Multidimensional Arrays Using Array Functions
is_array count sort shuffle explode extract compact reset end
Test Your Knowledge
7. Practical PHP
Using printf
Precision Setting String Padding Using sprintf
Date and Time Functions
Date Constants Using checkdate
File Handling
Checking Whether a File Exists Creating a File Reading from Files Copying Files Moving a File Deleting a File Updating Files Locking Files for Multiple Accesses Reading an Entire File Uploading Files
Using $_FILES Validation
System Calls XHTML
The Benefits of XHTML XHTML Versions What’s Different? HTML 4.01 Document Types The HTML5 Document Type XHTML 1.0 Document Types XHTML Validation
Test Your Knowledge
8. Introduction to MySQL
MySQL Basics Summary of Database Terms Accessing MySQL via the Command Line
Starting the Command-Line Interface
Windows users OS X users Linux users MySQL on a remote server
Using the Command-Line Interface
The semicolon Canceling a command
MySQL Commands
Creating a database Creating users Creating a table
Data Types
The CHAR data type The BINARY data type The TEXT and VARCHAR data types The BLOB data type Numeric data types DATE and TIME The AUTO_INCREMENT data type Adding data to a table Renaming a table Changing the data type of a column Adding a new column Renaming a column Removing a column Deleting a table
Indexes
Creating an Index
Using CREATE INDEX Adding indexes when creating tables Primary keys Creating a FULLTEXT index
Querying a MySQL Database
SELECT SELECT COUNT SELECT DISTINCT DELETE WHERE LIMIT MATCH...AGAINST MATCH…AGAINST…IN BOOLEAN MODE UPDATE…SET ORDER BY GROUP BY
Joining Tables Together
NATURAL JOIN JOIN...ON Using AS
Using Logical Operators
MySQL Functions Accessing MySQL via phpMyAdmin
Windows Users OS X Users Linux Users Using phpMyAdmin
Test Your Knowledge
9. Mastering MySQL
Database Design
Primary Keys: The Keys to Relational Databases
Normalization
First Normal Form Second Normal Form Third Normal Form When Not to Use Normalization
Relationships
One-to-One One-to-Many Many-to-Many Databases and Anonymity
Transactions
Transaction Storage Engines Using BEGIN Using COMMIT Using ROLLBACK
Using EXPLAIN Backing Up and Restoring
Using mysqldump Creating a Backup File
Backing up a single table Backing up all tables
Restoring from a Backup File Dumping Data in CSV Format Planning Your Backups
Test Your Knowledge
10. Accessing MySQL Using PHP
Querying a MySQL Database with PHP
The Process Creating a Login File Connecting to MySQL
Selecting a database Building and executing a query Fetching a result Fetching a row Closing a connection
A Practical Example
The $_POST Array Deleting a Record Displaying the Form Querying the Database Running the Program
Practical MySQL
Creating a Table Describing a Table Dropping a Table Adding Data Retrieving Data Updating Data Deleting Data Using AUTO_INCREMENT
Using insert IDs Using locks
Performing Additional Queries Preventing SQL Injection
Using placeholders
Preventing HTML Injection
Test Your Knowledge
11. Form Handling
Building Forms Retrieving Submitted Data
register_globals: An Old Solution Hangs On Default Values Input Types
Text boxes Text areas Checkboxes Radio buttons Hidden fields Select Labels The submit button
Sanitizing Input
An Example Program Test Your Knowledge
12. Cookies, Sessions, and Authentication
Using Cookies in PHP
Setting a Cookie Accessing a Cookie Destroying a Cookie
HTTP Authentication
Storing Usernames and Passwords Salting
Using Sessions
Starting a Session Ending a Session
Setting a timeout
Session Security
Preventing session hijacking Preventing session fixation Forcing cookie-only sessions Using a shared server
Test Your Knowledge
13. Exploring JavaScript
JavaScript and HTML Text
Using Scripts Within a Document Head Older and Nonstandard Browsers Including JavaScript Files Debugging JavaScript Errors
Using Comments Semicolons Variables
String Variables Numeric Variables Arrays
Operators
Arithmetic Operators Assignment Operators Comparison Operators Logical Operators Variable Incrementing and Decrementing String Concatenation Escaping Characters
Variable Typing Functions Global Variables
Local Variables
The Document Object Model (DOM)
But It’s Not That Simple
Another use for the $
Using the DOM
Test Your Knowledge
14. Expressions and Control Flow in JavaScript
Expressions
Literals and Variables
Operators
Operator Precedence Associativity Relational Operators
Equality operators Comparison operators Logical operators
The with Statement Using onerror Using try...catch Conditionals
The if Statement
The else statement
The switch statement
Breaking out Default action
The ? Operator
Looping
while Loops do…while Loops for Loops Breaking Out of a Loop The continue Statement
Explicit Casting Test Your Knowledge
15. JavaScript Functions, Objects, and Arrays
JavaScript Functions
Defining a Function
The arguments array
Returning a Value Returning an Array
JavaScript Objects
Declaring a Class Creating an Object Accessing Objects The prototype Keyword
Static methods and properties Extending JavaScript objects
JavaScript Arrays
Numeric Arrays
Assigning element values Assignment using the Array keyword
Associative Arrays Multidimensional Arrays Using Array Methods
concat forEach (for non-IE browsers) forEach (a cross-browser solution) join push and pop Using reverse sort
Test Your Knowledge
16. JavaScript and PHP Validation and Error Handling
Validating User Input with JavaScript
The validate.html Document (Part One)
How it works
The validate.html Document (Part Two)
Validating the forename Validating the surname Validating the username Validating the password Validating the age Validating the email address Using a separate JavaScript file
Regular Expressions
Matching Through Metacharacters Fuzzy Character Matching Grouping Through Parentheses Character Classes
Indicating a range Negation
Some More Complicated Examples Summary of Metacharacters General Modifiers Using Regular Expressions in JavaScript Using Regular Expressions in PHP
Redisplaying a Form After PHP Validation Test Your Knowledge
17. Using Ajax
What Is Ajax? Using XMLHttpRequest Implementing Ajax via POST Requests
The readyState Property The Server Half of the Ajax Process
Using GET Instead of POST Sending XML Requests
About XML Why Use XML?
Using Frameworks for Ajax Test Your Knowledge
18. Introduction to CSS
Importing a Style Sheet
Importing a Style Sheet from Within HTML
Embedded Style Settings
Using IDs Using Classes
CSS Rules
Using Semicolons Multiple Assignments Using Comments
Style Types
Default Styles User Styles External Style Sheets Internal Styles Inline Styles
CSS Selectors
The Type Selector The Descendant Selector The Child Selector The Adjacent Sibling Selector The ID Selector
Reusing IDs
The Class Selector
Narrowing class scope
The Attribute Selector The Universal Selector Selecting by Group
The CSS Cascade
Style Sheet Creators Style Sheet Methods Style Sheet Selectors
Calculating specificity Using a different number base Some rules are more equal than others
The Difference Between <div> and <span> Measurements Fonts and Typography
font-family font-style font-size font-weight
Managing Text Styles
Decoration Spacing Alignment Transformation Indenting
CSS Colors
Short Color Strings Gradients
Positioning Elements
Absolute Positioning Relative Positioning Fixed Positioning Comparing Positioning Types
Pseudoclasses Pseudoelements Shorthand Rules The Box Model and Layout
Setting Margins Applying Borders Adjusting Padding Object Contents
Test Your Knowledge
19. Advanced CSS with CSS3
Attribute Selectors
Matching Parts of Strings
The ^ operator The $ operator The * operator
The box-sizing Property CSS3 Backgrounds
The background-clip Property The background-origin Property The background-size Property
Using the auto value
Multiple Backgrounds
CSS3 Borders
The border-color Property The border-radius Property
Box Shadows Element Overflow Multicolumn Layout Colors and Opacity
HSL Colors HSLA Colors RGB Colors RGBA Colors The opacity Property
Text Effects
The text-shadow Property The text-overflow Property The word-wrap Property
Web Fonts
Google Web Fonts
Transformations Transitions
Properties to Transition Transition Duration Transition Delay Transition Timing Shorthand Syntax
Test Your Knowledge
20. Accessing CSS from JavaScript
Revisiting the getElementById Function
The O Function The S Function The C Function
Using the C function
Including the Functions
Accessing CSS Properties from JavaScript
Some Common Properties Other Properties
Inline JavaScript
The this Keyword Attaching Events to Objects in a Script Attaching to Other Events
Adding New Elements
Removing Elements Alternatives to Adding and Removing Elements
Using Interrupts
Using setTimeout
Passing a string Repeating timeouts
Canceling a Timeout Using setInterval
Using the function Canceling an interval
Using Interrupts for Animation
Test Your Knowledge
21. Bringing It All Together
Designing a Social Networking Site On the Website functions.php
The Functions
header.php setup.php index.php signup.php
Checking for Username Availability
checkuser.php login.php profile.php
Adding the “About Me” Text Adding a Profile Image Processing the Image Displaying the Current Profile
members.php
Viewing a User’s Profile Adding and Dropping Friends Listing All Members
friends.php messages.php logout.php styles.css
A. Solutions to the Chapter Questions
Chapter 1 Answers Chapter 2 Answers Chapter 3 Answers Chapter 4 Answers Chapter 5 Answers Chapter 6 Answers Chapter 7 Answers Chapter 8 Answers Chapter 9 Answers Chapter 10 Answers Chapter 11 Answers Chapter 12 Answers Chapter 13 Answers Chapter 14 Answers Chapter 15 Answers Chapter 16 Answers Chapter 17 Answers Chapter 18 Answers Chapter 19 Answers Chapter 20 Answers
B. Online Resources
PHP Resource Sites MySQL Resource Sites JavaScript Resource Sites Ajax Resource Sites Miscellaneous Resource Sites O’Reilly Resource Sites
C. MySQL’s FULLTEXT Stopwords D. MySQL Functions
String Functions
CONCAT() CONCAT_WS() LEFT() RIGHT() MID() LENGTH() LPAD() RPAD LOCATE() LOWER() UPPER() QUOTE() REPEAT() REPLACE() TRIM() LTRIM() and RTRIM()
Date Functions
CURDATE() DATE() DATE_ADD() DATE_FORMAT() DAY() DAYNAME() DAYOFWEEK() DAYOFYEAR() LAST_DAY() MAKEDATE() MONTH() MONTHNAME() SYSDATE() YEAR() WEEK() WEEKDAY()
Time Functions
CURTIME() HOUR() MINUTE() SECOND() MAKETIME() TIMEDIFF() UNIX_TIMESTAMP() FROM_UNIXTIME()
Index About the Author Colophon Copyright
  • ← Prev
  • Back
  • Next →
  • ← Prev
  • Back
  • Next →

Chief Librarian: Las Zenow <zenow@riseup.net>
Fork the source code from gitlab
.

This is a mirror of the Tor onion service:
http://kx5thpx2olielkihfyo4jgjqfb7zx7wxr3sd4xzt26ochei4m6f7tayd.onion