HTML Elements - Part 2 : Form Introduction

Hello There Pretty Brain ...

In this tutorial, we continue with the introduction to HTML elements. We started this journey in HTML Elements 1. And now we're looking to throw a couple more elements into that pretty brain of yours.

This tutorial is part of the Build Your Own Site tutorial series. Feel free to start the series from scratch if you're interested in building your own site.

Ready ...

<img src="wrongname.gif" alt="HTML5 Icon" style="width:128px;height:128px;">
<img src="rightname.gif" alt="HTML5 Icon" style="width:128px;height:128px;">

Okay take a break, eat a cookie, and a whole sheep carcass and come back.

Let's get back in there ...

<form>
.
form inputs
.
</form>
<form action="action_page.php">

</form>
The action attribute defines the action performed when the user submits the form. Note that the action value in our form above is a php file named action_page.php. This means that when the form is submitted (don't worry we'll get to submitting forms soon) the action_page.php will be loaded and run by the server. The action_page.php file will probably have some php code that can handle the incoming data, process it, and respond accordingly. We'll get to this a bit later in these lessons. The next form attribute on our list is the method attribute. This attribute is used to specify which http request method will be used to send the form data. Okay take a deep breath and sip some tea, we're about to go just a little deeper and explain this for you. When you send data on the server; you're making what they call an http request. HTTP is an acronym for Hypertext Transfer Protocol. Remember HTML is short for Hypertext Markup Language, so an HTTP Request will be a method to transfer HTML data across and within servers. So this "method" attribute helps us choose, or rather select a way to transfer our data. In these tutorials we'll be looking at two HTTP methods, GET and POST. Think of the two this way; GET shows the data in the url like so "/test/demo_form.php?name1=value1&name2=value2". Whilst POST hides the data, making them visible only to the scripts it's sending to. We won't be submitting or transferring any data as yet. For now; Just be happy that you understand a bit about how we transfer data across sites and servers. In the next tutorial, we'll look at the various form inputs ..

"Remember HTML is short for "Hypertext Markup Language", so an HTTP Request will be a method to transfer "HTML data" across and within servers."

The Village Geek

"Alright alright, alirght ..." - Matthew McConaughey

See you in the next page partner.

Cape Town, South Africa

Buy me a coffee ? :) Buy me a coffee :)

Reply to this discussion

Bookmarks


Learn
Coming Soon ...