Author: Awais Farooq
-
Error Handling
Error handling in PHP refers to the making a provision in PHP code to effectively identifying and recovering from runtime errors that the program might come across. In PHP, the errors are handled with the help of − The die() Function The die() function is an alias of exit() in PHP. Both result in termination…
-
Regular Expressions
Regular expressions are nothing more than a sequence or pattern of characters itself. They provide the foundation for pattern-matching functionality. Using regular expression you can search a particular string inside a another string, you can replace one string by another string and you can split a string into many chunks. PHP offers functions specific to…
-
Coding Standard
Every company follows its own coding standard based on its best practices. Coding standard is required because there may be many developers working on different modules so if they will start inventing their own standards then source will become very un-manageable and it will become difficult to maintain that source code in future. Here are…
-
Array Destructuring
In PHP, the term Array destructuring refers to the mechanism of extracting the array elements into individual variables. It can also be called unpacking of array. PHP’s list() construct is used to destrucrure the given array assign its items to a list of variables in one statement. As a result, val1 is assigned to $var1, val2 to $var2 and so on.…
-
File Configuration
On installing PHP software on your machine, php.ini is created in the installation directory. In case of XAMPP, php.ini is found in c:\xamm\php folder. It is an important configuration file that controls the performance and sets all the PHP related parameters. The phpinfo() function displays a list of different parameters and their current values of…
-
MySQL
PHP will work with virtually all database software, including Oracle and Sybase but most commonly used is freely available MySQL database. What you should already have ? We have divided this chapter in the following sections −
-
MySQL Login
MySQL is a popular choice as a backend database for PHP powered web applications. In this chapter, we shall learn to develop a login page for a PHP application that authenticates the given username and password. You should have a web server having PHP and MySQL installed for experimenting with the example discussed in this…
-
Paypal Integration
PayPal is a payment processing system. We can integrate PayPal with websites by using with PHP. PayPal Integration File System PayPal integration file system included four files as shown below − The user has to download a PayPal SDK file from here and exact a zip file. The zip file contains four PHP files. We…
-
Facebook Login
Users can be asked to log into a web application with the help of Social media login, also called SSO. This way users need not create a new account. Instead, users can use their existing social media account information to log in. Some examples of social media login include: Google, Facebook, LinkedIn, Apple. In this…
-
Login Example
A typical PHP web application authenticates the user before logging in, by asking his credentials such as username and password. The credentials are then checked against the user data available with the server. In this example, the user data is available in the form of an associative array. The following PHP Login script is explained below − HTML…