Web Development using PHP 5: Beginner to Advanced (Fast Track)

Course Outline

Course objectives Participants attending this training program will learn the following:
  • Brief understanding of the XAMPP stack.
  • In-depth knowledge of PHP5 programming.
  • Web masters seeking knowledge on Joomla based websites.
  • Web development concepts that include Session management, Cookies, File upload handling, string and array manipulation, advanced OOP concepts in PHP5 and SQL database driven website development using PHP5.

Recommended duration 40 hours
(5 days @ 8 hours per day)
Target audience
  • Web developers intending to migrate to PHP development using XAMPP stack.
  • PHP developers who wish to learn in-depth concepts and features of PHP5 programming language.
  • Web masters seeking knowledge on PHP development and PHP based application deployment on a XAMPP stack.
Pre-requisites
  • Good experience on Web development using any programming language/stack.
  • Indepth knowledge of PHP programming language.
  • Good knowledge of the following web technologies:
    • HTTP protocol, web servers and web browsers.
    • HTML, XHTML markup language and basics of XML.
    • Basic understanding of JavaScript and CSS.
    • Basic understanding of SQL compliant RDBMS with knowledge of SQL commands and constructs.
Training fee Rs. 15,000/- only (introductory offer)
  • Participants can attend the first day of the training program free of cost.
  • If they are fully satisfied with the first day of the training program, they can continue attending the remaining days after full payment of the training fee.

Click here to register or drop us an e-mail to: registrations at slashprog dot com

Click here to check the scheduled training programs.

Course coverage

Day Description
Day 1 Overview of (L|W|S)AMP stack
  • Introduction to web applications
  • Open source web application stack.
  • An overview of XAMPP stack.
  • XAMPP vs. Other web-application stack

Overview of PHP

  • Basic concepts of scripting.
  • Getting started on PHP.
  • Features and benefits of PHP.
  • PHP4 vs PHP5
  • PHP in comparison with other web application scripting engines.
  • PHP script syntax and semantics.
  • PHP script tags.
  • Embedding PHP script tags in HTML.
  • Generating output using print() and echo() statements
  • Comments in PHP.
  • Built-in functions - nl2br(), date(), time()
  • Basic PHP coding style and conventions

PHP data-types

  • Introduction to PHP variables and data-types.
  • PHP variable naming rules and conventions
  • Scalar data-types
    • boolean, integer, float, string
  • Compound data-types
    • arrays and objects (overview)
  • Special types
    • resources and NULL type
  • Pseudo-types
    • mixed, number and callback types
  • Features, limitations and gotchas of dynamic typing.
  • Type determination and type conversion.
  • Type conversion rules and Type-Juggling in PHP
    • gettype(), settype() functions
    • is_bool(), is_float(), is_int(), is_null(), is_string()
    • is_numeric(), is_resource()
    • is_object() and is_array() functions
    • intval(), floatval() and strval() functions
  • Checking variable definition
    • isset(), unset() and empty() statements
  • Using var_dump(), var_export() and print_r() functions
  • Variable scope
    • Local variables
    • Gobal variables
    • Supergobals
    • Static variables
  • Variable variables (references)
  • Defining and using constants
  • Magic constants
    • __LINE__, __FILE__, __FUNCTION__, __CLASS__, __METHOD__
  • Using the Superglobal array $_REQUEST[]

PHP Expressions and Operators

  • Assignment expressions and operators.
  • Arithmetic expressions and operators
  • Comparison expressions and condition evaluation
  • Boolean operators
  • Error-control and Execution operators
  • String and Array operators
  • Type operators

PHP Control Structures

  • Conditional constructs
    • if .. else .. structures
    • The ternary operator
    • Short-circuit operators
    • The switch .. case structure
  • Looping constructs
    • while loop
    • do .. while loop
    • for loop
    • foreach loop
    • Loop control statements - break, continue
  • Alternative syntax for control structures
  • Script inclusion and control
    • Using the require(), include(),
    • require_once() and include_once() statements
    • Using the eval() statement
    • Using the die()/exit() statement

Hands On

  • Practice basic PHP scripts
  • Small exercises emphasizing on PHP type determination, type conversions and type juggling
  • A simple web-based multiplication table generator.
  • A simple PHP-based web application to generate employee salary slip

Day 2 Built-in String functions (demonstrations with examples and code walk-through)
  • chop(), chr(), ord(), printf(), sprintf(), strlen(), count()
  • crypt(), md5(), sha1()
  • parse_str(), similar_text(), strcmp(), strncmp(), strcasecmp()
  • join(), split(), implode(), explode()
  • htmlentities(), htmlspecialchars() and html_entity_decode()
  • urlencode(), urldecode()
  • str_shuffle(), str_split()
  • str_replace, sscanf(), strstr(), substr(), strpos()
  • strtolower(), strtoupper(), ucfirst(), ucwords()

Using arrays in PHP

  • An overview on Associative arrays in PHP
  • Creating/Defining arrays (using array() statement)
  • Setting/accessing array elements
  • Checking existence of array elements
  • Counting elements of an array (count() function)
  • Array conversions
  • Comparing arrays
  • Iterating over array contents
  • Pretty-printing arrays
  • Sorting arrays
  • Recursive/multi-dimensional arrays
  • Using the list() statement

Array functions (Demonstration with examples)

  • array_keys(),array_key_exists()
  • array_values(),array_flip()
  • array_map(),array_combine(), array_merge()
  • array_count_values(),array_diff()
  • array_fill(),array_filter()
  • array_push(),array_pop(), array_shift(), array_unshift()
  • array_intersect(),array_reduce(), array_reverse()
  • array_search(),array_slice(), array_splice()
  • array_unique(),array_walk()
  • asort(),arsort(), ksort(), krsort(), sort, rsort()
  • each(),current(), end(), reset(), prev(), next()
  • compact(),extract()
  • in_array(),key(), range(), sizeof()

Functions in PHP

  • User defined functions
  • Function arguments
  • Returning values (using return() statement)
  • Conditional functions
  • Functions within functions
  • Variable functions
  • Default arguments
  • Variable-length argument lists
    • Using func_num_args(), func_get_arg() and func_get_args()
  • Passing arguments by reference
  • Creating anonymous functions using create_function()
  • Checking existence of a function using function_exists()
  • Checking defined functions using get_defined_functions()
  • Using the is_callable() function

Useful built-in functions

  • connection_status(),connection_aborted(), connection_timeout()
  • constant(),defined()
  • get_browser(),php_check_syntax(), highlight_file()
  • sleep(),time_nanosleep(), usleep(), uniqid()
  • mail()function

Hands On

  • A simple web-based application to authenticate users using user-records stored in an array.
  • A simple web-based password generator.
  • A script to count number of words in string.
  • Small exercises that emphasize control structures and string functions.
  • Small exercises that emphasize array manipulation functions.
  • Small exercises that emphasize function manipulation.
  • Display different web pages for different web browsers.

Day 3 Handling files in PHP
  • Reading and Writing files
    • Using fopen(), fclose(), fread() and fwrite() functions
    • Using file(), file_get_contents(), file_put_contents()
    • Using readfile() and fpassthru()
  • URL style file parameters
    • Filesystem,HTTP/HTTPS, Socket, FTP, SSH streams
    • Handling compressed streams
  • File manipulation functions
    • Checking for file existence
    • Determining file type
    • Copying,Moving and Deleting files
    • Creating temporary files
  • Directory manipulation
    • Creating,Moving and Removing directories
    • Determining directory name and filename component of a path
    • Globbing
    • Changing directory
    • Reading directory contents
  • Handling File Uploads in PHP
    • Creating file upload forms
    • Using the $_FILES[] Superglobal array
    • Using is_uploaded_file() and move_uploaded_file() functions
    • Uploading multiple files

HTTP functions in PHP

  • header(),headers_list(), headers_sent() functions
  • Performing URL redirections
  • HTTP authentication in PHP
  • Managing sessions and cookies

Predefined Superglobal variables (re-visited)

  • $GLOBALS[] array
  • $_SERVER[] array
  • $_GET[] array
  • $_POST[] array
  • $_COOKIE[] array
  • $_FILES[] array
  • $_REQUEST[]array
  • $_ENV[] array
  • $_SESSION[] array

Built-in features based on Predefined Superglobals

  • Determining HTTP server identity
  • Determining client IP address and identity
  • Determining document root and script filename
  • Determining request method
  • Determining HTTP REFERER information

Hands On

  • A simple web-based application to determine and print the following statistics of an uploaded file:
    • Size of the file
    • Name of the file
    • Number of words in file
    • Number of lines in file
    • A table showing occurrence of each character in file
    • A table showing occurrence of each word in file
  • A simple web-based document repository system that does the following:
    • Authenticate users based on user records stored in file
    • Allow authenticated users to manage folders, upload files and manage them on server.
  • A simple PHP script to print the following details
    • Client's IP address
    • Client's user agent string
    • Client's HTTP REFERER URL
  • A simple PHP script to track user access using cookies

Day 4 Using Regular Expressions in PHP
  • An overview on Regular Expressions and Patterns
    • PCRE Vs. POSIX Extended RE
    • Pattern syntax and semantics
    • Pattern modifiers
    • Meta-characters
    • Back-slashes
    • Anchors
    • Wild-cards
    • Quantifiers
    • Alternation
    • Grouping and extraction
    • Back references
  • Using PCRE functions
    • preg_grep(),preg_match() and preg_match_all()
    • preg_replace() and preg_split()
  • Using POSIX Extended Regular Expression functions
    • ereg(),eregi(), ereg_replace(), eregi_replace()
    • split(),spliti()

Classes And Objects

  • Introduction to OOP
  • The PHP5 Object model
  • PHP4 vs PHP5 Object model
  • Defining Classes
  • Instantiating Objects
  • Constructors and Destructors
  • Cloning
    • Using the __clone() method
  • Using the identity operator
  • Members and Visibility
  • Class inheritance
  • self::,parent:: and $this constructs
  • Static members
  • Abstract methods and Abstract classes
  • Finalmethods and Final classes
  • Overloading
    • Using __set(), __get(), __isset(), __unset() methods
    • Using the __call() method
  • Interfaces
  • Serializing Objects
    • Using __wakeup() and __sleep() methods
    • Using __toString() method
  • Handling Exceptions
    • throwing exceptions
    • Catching exceptions using try .. catch construct
    • Exception hierarchy and standard exceptions.
  • Packages and PEAR/PECL package repository

Hands On

  • Exercises that emphasize on Regular Expression functions
    • Server-side validation of form data
    • Validate email address, date/time, age, telephone numbers
    • Validate IP address
    • Extract URLs from a file
    • Validate text input and strip out potentially dangerous HTML tags
  • Exercises that emphasize OOP concepts and features
    • Create a simple web application framework that supports rudimentary templating with MVC based architecture

Day 5 PHP Database connectors and API
  • An overview on native database connectors
  • Database abstraction libraries - PEAR::DB, ADODB and PDO API
  • Using MySQL Databases with PHP
    • MySQL Vs. MySQLi extensions
  • Managing MySQL database using MySQLi extensions
    • Procedural style Vs. OO-style semantics
    • Creating new database connection
    • Checking for mysql connection errors
    • Checking for mysql connection information
    • Executing mysql queries
    • Managing prepared query execution
    • Binding parameters and results for prepared queries
    • Fetching data from query result sets
    • Managing MySQL transactions
    • An overview on MySQL storage engines
  • Managing SQLite3 database using PHP5's built-in SQLite support
    • An overview on SQLite3 features
    • Creating new database and opening existing databases
    • Executing SQLite3 queries
    • Binding parameters and results for prepared queries
    • Fetching data from query result sets of SQLite3
    • SQLite3 transaction support
    • SQLite3 Vs. MySQL

An overview on PHP.INI settings

  • Short tag option
  • Output buffering
  • Register globals setting
  • Safe mode setting
  • Resource limitations
  • Error reporting features
  • POST data limits and File upload size limits
  • Include path and Extensions path
  • URL file handling
  • Enabling/Disabling optional extensions
  • MySQLi extension-specific settings

Hands On

  • Creating a simple blog application with following features:
    • Allow new users to register into the site.
    • Send activation key to user's email and activate the account only when the user enters the correct key.
    • Upon login, allow users to post blog and also allow them to access blog entries by other users.
    • All user information and blog entries are to be stored in a database.