Category: PHP Tutorial

python tutorials and learn python

Created with Sketch.

PHP Checkbox

PHP Checkbox Summary: in this tutorial, you will learn how to use PHP to process a form with one or more checkboxes. A quick introduction to the checkbox element A checkbox allows you to select a single value for submission in a form. To create a checkbox, you use the input element with the type…
Read more

PHP Form Validation

PHP Form Validation Summary: in this tutorial, you’ll learn about PHP form validation, how to validate form data, and how to show error messages if the user inputs are invalid. Introduction to PHP form validation When processing a form, it’s critical to validate user inputs to ensure that the data is in a valid format.…
Read more

PHP filter_input

PHP filter_input Summary: in this tutorial, you will learn how to use the PHP filter_input() function to get an external variable by name and filter it. Introduction to PHP filter_input() function The PHP filter_input() function allows you to get an external variable by its name and filter it using one or more built-in filters. The…
Read more

PHP filter_var

PHP filter_var Summary: in this tutorial, you will learn how to use the PHP filter_var() function to sanitize and validate data. Introduction to the PHP filter_var() function When dealing with external data, you need to sanitize and validate it for security purposes. The external data may come from user inputs or third-party API. A good…
Read more

PHP filter_has_var

PHP filter_has_var Summary: in this tutorial, you’ll learn about the filter_has_var() function and how to use it to check if a variable exists in an input. Introduction to the filter_has_var() function The filter_has_var() function checks if a variable of a specified type exists. Here’s the syntax of the filter_has_var() function: filter_has_var ( int $input_type ,…
Read more

PHP Form

PHP Form Summary: in this tutorial, you will learn how HTML forms work and how to process form data in PHP. Introduction to PHP form processing To create a form, you use the <form> element as follows: <form action=”form.php” method=”post”> </form> Code language: HTML, XML (xml) The <form> element has two important attributes: action: specifies…
Read more

PHP Session

PHP Session Summary: in this tutorial, you will learn how to work with PHP sessions to preserve the state of the web application across pages during a session. Introduction to PHP sessions The HTTP protocol is stateless. For example, when you visit the product page product.php, the web server responds with the page: Suppose, you…
Read more

PHP Cookies

PHP Cookies Summary: in this tutorial, you’ll learn about cookies and how to use the PHP setcookie() function to manage cookies effectively. Introduction to cookies The web works based on the HTTP protocol. The HTTP protocol is stateless. When the web browser requests a page from a web server, the webserver responds with the page…
Read more

PHP Variable Variables

PHP Variable Variables Summary: in this tutorial, you’ll learn about PHP variable variables and how to apply them effectively. Introduction to the PHP variable variables Typically, you have a variable with a predefined name. For example, the following defines a variable with the name $title that holds a string. <?php $title = ‘PHP variable variables’;…
Read more

How to Use the PHP __DIR__ to Include a File

PHP __DIR__ Summary: in this tutorial, you’ll learn about how to use the PHP __DIR__ magic constant when including a PHP file. Introduction to the PHP __DIR__ magic constant PHP 5.3 introduced a new magic constant called __DIR__. When you reference the __DIR__ inside a file, it returns the directory of the file. The __DIR__…
Read more