PHP Tutorial

Error Handling In PHP

Error handling in PHP is a fairly straightforward process. PHP will simply send to the browser (or standard output if executing a script from the command line).* an error message containing relative information to the error such as the filename of the script, the specific line in the file that caused the error, * a …

Error Handling In PHP Read More »

What is a Cookie?

Cookies are pieces of text that are sent to a user’s web browser. Cookies can help you create shopping carts, user communities, and personalized sites. It’s not recommended that you store sensitive data in a cookie, but you can store a unique identification string that will match a user with data held securely in a …

What is a Cookie? Read More »

Creating and Using Cookie

Cookies are created in PHP using the setcookie() function. setcookie() takes a number of arguments. The first argument is the name of the cookie (the name part of the name/value pair described earlier). The second is the value part of the name/value pair.   The third argument is the optional expiration date of the cookie. …

Creating and Using Cookie Read More »

What is a PHP Session?

PHP Sessions allow web pages to be treated as a group, allowing variables to be shared between different pages. One of the weaknesses of cookies is that the cookie is stored on the user’s computer (and by user we mean the person with the browser visiting your web site). This provides the user the ability …

What is a PHP Session? Read More »

Using Session management in PHP

Creating a PHP Session   PHP sessions are created using the session_start() function which should the first function call of the PHP script on your web page (i.e before any output is written to the output stream).   The following example demonstrates the creation of a PHP session:   <?php session_start(); $msg=”Session Created”; ?> <!DOCTYPE …

Using Session management in PHP Read More »

PHP E-mail

The Mail () Function   Many websites offer a way for you to send them an email from a simple form on their site. Providing the form as opposed to simply listing your email address not only looks nicer but also serves two purposes.   1. First, the form lets the website owner decide what …

PHP E-mail Read More »

Date Function In PHP

While PHP’s date() function may seem to have an overwhelming amount of options available, isn’t it always better to have more choices than not enough? With PHP’s date function you format timestamps, so they are more human readable.   The PHP date() function formats a timestamp to a more readable date and time.   Syntax …

Date Function In PHP Read More »

PHP XML

In spite of the growing popularity of XML for storing and exchanging data of nearly any kind imaginable, XML is not well suited to act as a direct replacement for some of its defined subsets or sublanguages, like HTML.   This is because XML defines only a standard for structuring data XML itself fails (indeed, …

PHP XML Read More »

PHP Filter

A PHP filter is used to validate and filter data coming from insecure sources. To test, validate and filter user input or custom data is an important part of any web application. The PHP filter extension is designed to make data filtering easier and quicker.   Why we need to use a Filter?   Almost …

PHP Filter Read More »

PHP Download Links

In this section we will provide you download links for all necessary software, required for learning and development.   Apache Download   Download Apache from: [http://httpd.apache.org/download.cgi]   MySQL Download   Download MySQL from MySQL website [http://dev.mysql.com/downloads/mysql/]   PHP Download   Download PHP from: http://www.php.net/downloads.php   Windows Apache+ MySQL +PHP bundles   XAMPP   Download XAMPP …

PHP Download Links Read More »