Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: PHP Form Processing Handling Forms Tutorial

When a user hits submit, what can we do?

Tutorial Details:

PHP/MySQL and Visual Basic with easy online tutorials

When setting up a html form, you need to open with the form tag, and then you need to specify how the information is going to be passed over to the page/script that is going to handle the form.

The way we define the method of sending the information, we use the METHOD form attribute, which can be wither get or post .. and to define where the form is going to be aimed at, we use the ACTION form attribute.

The above results from the form are going to be sent to the page "login.php", using the method "post". "Post" basically means that the variables are going to be hidden from the user, whereas the "get" method would have the variables showing in the URL.

Okay. Thats great. Now what do I do with the information that was entered?
The information that was entered in the form can be accessed in one of two ways. If the method of the form was "post" , then all of the variables are going to be held in the array $_POST , whereas if the method of the form was "get" , then all of the variables are going to be held in $_GET . When building a script, if you are unsure of how the variables are going to be coming in, or if you know that you are going to need to accept the variables from both "get" and "post" methods, then you can access both "post" and "get" variables from the $_REQUEST array.

To access the different elements of the form (e.g. textboxes, textareas), you need to give them all a unique name on the html form. As you can see above, the name of the text element is "UID", and the name of the password box is "PWD". The method is "post", so to get at the contents of the username box, I can type.. $_POST['UID']. Easy? Easy.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
PHP Form Processing Handling Forms Tutorial

View Tutorial:
PHP Form Processing Handling Forms Tutorial

Related Tutorials:

Write high-performance RMI servers and Swing clients - JavaWorld - April 1999
Write high-performance RMI servers and Swing clients - JavaWorld - April 1999
 
Building a Java servlet framework using reflection, Part 2 - JavaWorld February 2000
Building a Java servlet framework using reflection, Part 2 - JavaWorld February 2000
 
Advanced form processing using JSP
This article examines the processing of a user registration form using JSP and JavaBeans while implementing the Memento design pattern.
 
Matchmaking with regular expressions - JavaWorld July 2001
Matchmaking with regular expressions - JavaWorld July 2001
 
Boost Struts with
Boost Struts with XSLT and XML
 
Reinvented wheel
Reinvented wheel
 
A first look at JavaServer Faces, Part I
A first look at JavaServer Faces, Part Learn how to implement Web-based user interfaces with JSF
 
eva/3 Application Builder supports eclipse 3
What is eva/3 Application Builder? eva/3 Application Builder assumes responsibility for the design of forms and reports via an integrated GUI Builder, the execution of procedures and the handling of diverse relational SQL databases through JDBC int
 
Handling Events in JavaServer Faces, Part 1
In this excerpt from the book, author Hans Bergsten looks at the JSF event model, using examples to help explain what\'s going on "under the hood."
 
Advanced form processing using JSP
Processing HTML forms using servlets, or more often, CGI scripts, is one of the most common operations performed on the Web today. However, that JavaServer Pages (JSPs) can play a significant role in sophisticated form processing is a little-known secret.
 
Getting Started With the Mobile 3D Graphics API for J2ME
This tutorial introduces the Mobile 3D Graphics API for J2ME, JSR 184. The article presents an overview, potential application areas, the differences between JSR 184 and two related APIs, the classes in the new optional package, the programming model, the
 
Just Forms PDF library
The JustFormsPDF library is a Java class library for filling or editing interactive PDF forms on-the-fly. Empower your applications with the industry-standard PDF forms technology using JustFormsPDF.
 
Open Source Web Frameworks in Java
Open Source Web Frameworks in Java Open Source Web Frameworks in Java Struts Struts Frame work is the implementation of Model-View-Controller (MVC) design pattern for the JSP. Struts is maintained as a part of Apache Jakarta project and is open
 
Jakarta Struts Interview Questions
Jakarta Struts Interview Questions Jakarta Struts Interview Questions Q: What is Jakarta Struts Framework? A: Jakarta Struts is open source implementation of MVC (Model-View-Controller) pattern for the development of web based applications.
 
Introduction to the JSP Java Server Pages
Introduction to the JSP Java Server Pages Welcome to JSP Section Introduction To JSP Java Server Pages or JSP for short is Sun's solution for developing dynamic web sites. JSP provide excellent server side scripting support for creating database
 
We are providing Downloadable Version of Mandrake 10.1 Community Edition Linux CD's.
We are providing Downloadable Version of Mandrake 10.1 Community Edition Linux CD's. Mandrake 10.1 Community Edition Linux Now Available Mandrake 10.1 Community Edition CD's Mandrake 10.1 Community, released in Sept. 16, 2004 is an incremental
 
Brief Introduction to the Web Application development
Brief Introduction to the Web Application development Brief Introduction to the Web Application development Gone are the days of serving static HTML pages to the world. Now a days most website serves the dynamic pages based on the user and their
 
The Struts ActionForm Class
The Struts ActionForm Class The ActionForm Class In this lesson you will learn about the ActionForm in detail. I will show you a good example of ActionForm. This example will help you understand Struts in detail. We will create user interface to
 
Struts Validator Framework Tutorial with Example
Struts Validator Framework Tutorial with Example Struts HTML Tags Struts Validator Framework This lesson introduces you the Struts Validator Framework. In this lesson you will learn how to use Struts Validator Framework to validate the user
 

Understanding Struts Action Class In this lesson I will show you how to use Struts Action Class and forward a jsp file through it. What is Action Class? The Action Class is part of the Model and is a wrapper around the business logic. The purpose
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.