PHP
PHP Introduction
PHP is a server-side scripting language.
What You Should Already Know
Before you continue you should have a basic understanding of the [...]
PHP Installation
Apache friends Xampp
Download xampp and install all at once!
What do you Need?
If your server supports PHP you don’t [...]
PHP Syntax
PHP code is executed on the server, and the plain HTML result is sent to the [...]
PHP Variables
A variable is used to store information.
Variables in PHP
Variables are used for storing a values, like text strings, numbers [...]
PHP String Variables
A string variable is used to store and manipulate text.
String Variables in PHP
String variables are used for values that contains [...]
PHP Operators
Operators are used to operate on values.
PHP Operators
This section lists the different operators used in PHP.
Arithmetic Operators
Operator
Description
Example
Result
+
Addition
x=2
[...]
PHP If…Else Statements
Conditional statements are used to perform different actions based on different conditions.
Conditional Statements
Very often when you write code, [...]
PHP Switch Statement
Conditional statements are used to perform different actions based on different conditions.
The PHP Switch Statement
Use the switch statement [...]
PHP Arrays
An array stores multiple values in one single variable.
What is an Array?
A variable is a storage area holding a number [...]
PHP Looping – While Loops
Loops execute a block of code a specified number of times, or while a specified condition is true.
PHP [...]
PHP Looping – For Loops
Loops execute a block of code a specified number of times, or while a specified condition [...]
PHP Functions
The real power of PHP comes from its functions.
In PHP, there are more than 700 built-in functions.
PHP Functions
In this chapter [...]
PHP Forms and User Input
The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input.
PHP Form Handling
The [...]
PHP $_GET Function
The built-in $_GET function is used to collect values in a form with method="get".
The $_GET Function
The [...]
PHP $_POST Function
The built-in $_POST function is used to collect values in a form with method="post".
The $_POST Function
The [...]
PHP Date() Function
The PHP date() function is used to format a time and/or date.
The PHP Date() Function
The PHP date() function [...]
PHP Include File
Server Side Includes (SSI)
You can insert the content of one PHP file into another PHP file before the [...]
PHP File Handling
The fopen() function is used to open files in PHP.
Opening a File
The fopen() function is used to open files in [...]
PHP File Upload
With PHP, it is possible to upload files to the server.
Create an Upload-File Form
To allow users to upload files from [...]
PHP Cookies
A cookie is often used to identify a user.
What is a Cookie?
A cookie is often used to identify a [...]
PHP Sessions
A PHP session variable is used to store information about, or change settings for a user [...]
PHP Sending E-mails
PHP allows you to send e-mails directly from a script.
The PHP mail() Function
The PHP mail() function is used to send [...]
PHP Secure E-mails
There is a weakness in the PHP e-mail script in the previous chapter.
PHP E-mail Injections
First, look [...]
PHP Error Handling
The default error handling in PHP is very simple. An error message with file name, line [...]
PHP Exception Handling
Exceptions are used to change the normal flow of a script if a specified error occurs
What [...]
PHP Filter
PHP filters are used to validate and filter data coming from insecure sources, like user input.
What [...]
PHP MySQL Introduction
MySQL is the most popular open-source database system.
What is MySQL?
MySQL is a database.
The data in MySQL is stored in database [...]
PHP MySQL Create Database and Tables
A database holds one or multiple tables.
Create a Database
The CREATE DATABASE statement is used to create a database in MySQL.
Syntax
[...]
PHP MySQL Insert Into
The INSERT INTO statement is used to insert new records in a table.
Insert Data Into a Database Table
The [...]
PHP MySQL Select
The SELECT statement is used to select data from a database.
Select Data From a Database Table
The SELECT statement [...]
PHP MySQL Order By Keyword
The ORDER BY keyword is used to sort the data in a recordset.
The ORDER BY Keyword
The ORDER BY [...]
PHP MySQL Update
The UPDATE statement is used to modify data in a table.
Update Data In a Database
The UPDATE statement is used to [...]
PHP MySQL Delete
The DELETE statement is used to delete records in a table.
Delete Data In a Database
The DELETE FROM statement [...]
PHP Database ODBC
ODBC is an Application Programming Interface (API) that allows you to connect to a data source (e.g. an [...]
PHP XML Expat Parser
The built-in Expat parser makes it possible to process XML documents in PHP.
What is XML?
XML is [...]
PHP XML DOM
The built-in DOM parser makes it possible to process XML documents in PHP.
What is DOM?
The W3C [...]
PHP SimpleXML
SimpleXML handles the most common XML tasks and leaves the rest for other extensions.
What is SimpleXML?
SimpleXML [...]
AJAX Introduction
AJAX = Asynchronous JavaScript and XML
AJAX is not a new programming language, but a new technique for creating [...]
AJAX XMLHttpRequest
The keystone of AJAX is the XMLHttpRequest object.
AJAX uses the XMLHttpRequest object
To get or send information from/to a database or [...]
PHP Example – AJAX Suggest
AJAX can be used to create more interactive applications.
AJAX Suggest example
The following AJAX example will demonstrate how a [...]
PHP Example – AJAX and XML
AJAX can be used for interactive communication with an XML file.
AJAX XML example
The following example will [...]
PHP Example – AJAX and MySQL
AJAX can be used for interactive communication with a database.
AJAX database example
The following example will demonstrate how a [...]
PHP Example – responseXML
responseText returns the HTTP response as a string.
responseXML returns the response as XML.
AJAX ResponseXML example
The ResponseXML property returns an XML [...]
PHP Example – AJAX Live Search
AJAX can be used for a more user-friendly and interactive search.
AJAX Live Search
In this example we [...]
PHP Example – AJAX RSS Reader
An RSS Reader is used to read RSS Feeds.
AJAX RSS Reader
In this example we will demonstrate an RSS reader, where [...]
PHP Example – AJAX Poll
AJAX Poll
This example will demonstrate a poll where a web page can get results without reloading.
Do you like [...]
What is PHP?
Hypertext Preprocessor (the name is a recursive acronym) is a widely used, general-purpose scripting language that was originally designed for [...]
