Learn PHP Tutorial 31 Get checkbox value using PHP

Publicado el: 08 enero 2016
en el canal de: Champion Mahipal
7,640
26

This video is made for learning about Get checkbox value using PHP in PHP.

Dealing with Forms

One of the most powerful features of PHP is the way it handles HTML forms. The basic concept that is important to understand is that any form element will automatically be available to your PHP scripts.

The HTML Form

Before you can process the information, you need to create an HTML form that will send information to your PHP script. There are two methods for sending data: POST and GET. These two types of sending information are defined in your HTML form element's method attribute. Also, you must specify the location of the PHP file that will process the information.

Next, we are going to create our PHP file that will process the data. When you submit your HTML form PHP automatically populates two superglobal arrays, $_GET and $_POST, with all the values sent as GET or POST data, respectively. Therefore, a form input called 'Name' that was sent via POST, would be stored as $_POST['Name'].

$_GET is an array of variables passed to the current script via the URL parameters.

$_POST is an array of variables passed to the current script via the HTTP POST method.

When to use GET?
Information sent from a form with the GET method is visible to everyone (all variable names and values are displayed in the URL). GET also has limits on the amount of information to send. The limitation is about 2000 characters. However, because the variables are displayed in the URL, it is possible to bookmark the page. This can be useful in some cases.

GET may be used for sending non-sensitive data.

Note: GET should NEVER be used for sending passwords or other sensitive information!

When to use POST?
Information sent from a form with the POST method is invisible to others (all names/values are embedded within the body of the HTTP request) and has no limits on the amount of information to send.

To get value of multiple checked checkboxes, name attribute in HTML input type=”checkbox” tag must be initialize with an array, to do this write [ ] at the end of it’s name attribute


En esta página del sitio puede ver el video en línea Learn PHP Tutorial 31 Get checkbox value using PHP de Duración hora minuto segunda en buena calidad , que subió el usuario Champion Mahipal 08 enero 2016, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 7,640 veces y le gustó 26 a los espectadores. Disfruta viendo!