PHP Form Validation

PHP Form Validation is the process of verifying the user’s input. In PHP, there are two forms of validation. The following is a list of them: Client-Side Validation: It is used for field validation and is performed on client machine web browsers. Server-Side Validation: After form submission, data is forwarded to a server, which performs validation checks. … Read more

PHP Complete Form

Php Complete form example will be shown in this chapter: Let’s look at how to maintain input field data saved even after the form has been submitted. PHP Complete Form-Keep field value We add a small PHP script inside the value attribute of the following input fields: name, email, and website, to show the values … Read more

PHP Forms – Field Validation

The validation of form fields is demonstrated in this chapter. Let’s have a look at the form fields we’ll be creating. Field Validation Rules Name Must only contain letters and whitespace E-mail Must contain a valid email address (with @ and .) Website It must contain a valid URL We discussed required fields and errors … Read more

PHP Functions

A function is a block of code that takes more than one input in the form of a parameter, processes it, and then returns a value. There are two types of PHP functions: Built-in Functions User defined functions PHP Functions: Built-in To do a given operation, PHP includes over 1000 built-in functions that may be … Read more

PHP Superglobal Variables

As we have discussed PHP Global variables. Some PHP variables are “superglobals,” which means they are always reachable, irrespective of scope, and can be accessed from any function, class, or file without doing anything special. PHP Superglobal Variables The superglobals can be found all across your script. These variables can be accessed from any function, … Read more

PHP Cookie

A PHP cookie is a tiny file that the web server saves on the client computer, with a maximum size of 4KB. The cookie will be sent each time the same computer requests a page through a browser. They are often used to store track of information like a username that the site can use to … Read more

PHP Regular Expressions

Regular expressions are nothing more than a string of characters in a particular order. Regular Expressions (“regex” or “RegExp”) are specifically designed text strings that are used to find patterns in text. To generate complex expressions, regular expressions use arithmetic operators like (+,-,). They may assist you with activities such as validating email addresses and … Read more

PHP Session

A session is a frame of communication between two mediums. PHP sessions are used to temporarily store and transmit information from one page to another (until the user close the website). Problem:  The HTTP address does not keep state, So the web server has no idea who you are or what you do. Solution: Session variables … Read more

PHP Form Methods

For uploading data some PHP Form Methods are used such as Get or Post. These methods are written as value of method attribute and specifies the HTTP method to be used when submitting the form data. Both GET and POST are treated as $_GET and $_POST. These are superglobals, which means that they are always … Read more

PHP Date and Time

Whenever conducting SQL queries or constructing a website PHP date and time are two of the most commonly used functions in PHP. For these purposes, PHP provides predefined functions. The following sections go over some of PHP’s built-in date and time capabilities. PHP date() Function A timestamp is converted to a more readable date and … Read more