Category: PHP Tutorial

python tutorials and learn python

Created with Sketch.

PHP Validation

PHP Validation Summary: in this tutorial, you’ll learn to build a reusable PHP validation library from scratch. In previous tutorials, you learned how to validate a form field using the filter_input() and filter_var() functions. For example, the following sanitizes and validates the email field in the POST request: // validate email $email = filter_input(INPUT_POST, ’email’,…
Read more

PHP Contact Form

PHP Contact Form Summary: in this tutorial, you’ll learn how to build a contact form in PHP that includes form validation, sending email, honeypot, etc. Introduction to the PHP contact form A contact form allows visitors of a website to leave messages. Typically, a contact form has the name, email, subject, and message input fields.…
Read more

PHP Upload Multiple Files

PHP Upload Multiple Files Summary: in this tutorial, you’ll learn how to upload multiple files to the server in PHP securely. Introduction to the PHP upload multiple files In the previous tutorial, you learned how to upload a single file from a client to the webserver in PHP. All the rules of uploading a single…
Read more

PHP File Upload

PHP File Upload Summary: in this tutorial, you will learn how to create a file upload form and process uploaded files securely in PHP. Introduction to the file input element The <input> element with the type=”file” allows you to select one or more files from their storage and upload them to the server via the…
Read more

PHP PRG (Post-Redirect-Get)

PHP PRG (Post-Redirect-Get) Summary: in this tutorial, you’ll learn how to use the PHP PRG (Post-Redirect-Get) technique to prevent the double form submission problem. The double submit problem To change data on the server via a form, you often use the post method. When a form is submitted, you validate the data, update the database,…
Read more

PHP Flash Messages

PHP Flash Messages Summary: in this tutorial, you’ll learn about the PHP flash messages and define a reusable flash() function to manage the flash messages effectively. Introduction to the PHP flash messages A flash message allows you to create a message on one page and display it once on another page. To transfer a message…
Read more

PHP CSRF

PHP CSRF Summary: in this tutorial, you will learn about cross-site request forgery (CSRF) attacks and how to prevent them in PHP. What is CSRF CSRF stands for cross-site request forgery. It’s a kind of attack in which a hacker forces you to execute an action against a website where you’re currently logged in. For…
Read more

PHP Select Option

PHP Select Option Summary: in this tutorial, you will learn how to use the <select> element to create a drop-down list and a list box and how to get the selected values from the <select> element in PHP. A quick introduction to the <select> element The <select> is an HTML element that provides a list…
Read more

PHP Radio Button

PHP Radio Button Summary: in this tutorial, you’ll learn how to create a form with radio buttons and handle radio groups in PHP. Introduction to radio buttons To create a radio button, you use the <input> element with the type radio. For example: <input type=”radio” name=”contact” id=”contact_email” value=”email” /> Code language: HTML, XML (xml) A…
Read more

PHP Multiple Checkboxes

PHP Multiple Checkboxes Summary: in this tutorial, you will learn how to handle a form with multiple checkboxes in PHP. How to handle multiple checkboxes on a form A form may contain multiple checkboxes with the same name. When you submit the form, you’ll receive multiple values on the server under one name. To get…
Read more