PHP Forms Introduction | Tutorial
Course Title: Web Development Masterclass
Course Link: http://youaccel.com/admin/cdisplay.php?cid=11
Facebook: https://www.facebook.com/youaccel
Twitter: https://twitter.com/YouAccel
Website: http://youaccel.com
Tutorial Content:
In the next part of the course we are going to be discussing how to process HTML form data using PHP. The concepts explored here are very important because web pages interact with users using Forms.
Form data can be used for many things.
We can insert form data into a Database.
We can email form data to our users, such as a confirmation email or a thank you note.
We can also use form data to perform arithmetic, or perhaps a combination of any of these purposes.
Form processing starts as soon as we fill out an HTML form and click the submit button.
At this stage in the course you should be familiar with creating HTML forms. We know that the form element, has an action attribute.
In our html course, we did just about everything, except assign a value to our action attribute. It's the action that brings our form to life.
The action of our form will point to a PHP script. In addition to instructing our server on what to do with the form data, the PHP script can also validate the form. This means, we can check things like email addresses or phone numbers to make sure they are in the right format. We can also check to make sure that form inputs are not left empty, or put limits on how much data can be inputted. These are just a few examples.
PHP form validation is done on the server, meaning it is the most effective form of validation available. We did some JavaScript validation in the JavaScript course, but we also pointed out that JavaScript can be turned off by the user.
PHP validation cannot be turned off, making it the safest way to test form inputs for data accuracy.
We will be exploring two ways to transmit form data to our PHP script from our HTML form. The Get method and Post method.
In both methods, the data is transmitted in an array that is automatically generated. The array holds the key/value pairs. The keys are the name of the form controls and the value is the data inputted by the user. We will come back to this when we start creating our form.
There are some important points to note about POST vs. GET before we begin:
The GET method passes our array variables through the URL parameters
Should be used only for sending non-sensitive data
Never send passwords through the GET method.
All variables are displayed openly in the URL.
The GET method has limits on how much information can be sent.
The current limit is 2000 characters.
The POST method passes variables using the HTTP POST method.
The POST method is much more secure because variables are not displayed in the URL
Information is invisible to others because it is embedded within the body of the HTTP request.
It has no limits as to the amount of information we can send.
This method is preferred by developers
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «PHP Forms Introduction | Tutorial», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.