Home / code / html

Forms in your HTML-page.

With forms you can make interactive pages. Mostly in combination with java-script or with CGI-script.
You can ask your visitors to fill his email or his name or ...
You then can use this in a database or send it to you in a email or just to personalize the page.

Everything that you use in a form must be between,
<FORM></FORM>

Now you can add a action,
<FORM action="/scripts/email.plx"></FORM>
When you use a CGI-program.

<FORM action="mailto:yourname@yourprovider.com"></FORM>
If you want to receive it in your email box.

There are 2 way to send the information with METHOD:

  • POST sends the information separately
  • GET places the information at the end of URL
Example :
<FORM METHOD="post" action="/scripts/email.plx"></FORM>

The attribute ENCTYPE:
This gives the format in what format the information must be send.
The following line says that you upload in normal text, this is what you use most of the time.
<FORM METHOD="post" action="/scripts/email.plx" ENCTYPE="text/plain"></FORM>
If you want to upload files, images for example you need :
<FORM METHOD="post" action="/scripts/email.plx" ENCTYPE="multipart/form-data"></FORM>

You have 3 elements in FORM

 

TOP

Latest script:

 

Books: