Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Use XForms to create an accounting tool, Part 2: Logging in and accounts

Leverage the power of XForms for user authentication

Stony Yakovac (syakovac@gmail.com), Software engineer, Freelance
Stony Yakovac is an engineer and freelance author living in Lava Hot Springs, Idaho. He works on a wide variety of projects, including software and digital hardware designs.

Summary:  This six-part series demonstrates how to leverage the power of XForms in conjunction with MySQL and PHP for support processing to create an online accounting tool called X-Trapolate. Every good programming technology possesses a range of problems it excels at solving. The series highlights some of the problems that the XForms solves effectively, such as the need for live calculations and greater interactivity. Part 2 of this six-part series demonstrates how to leverage the power of XForms in conjunction with PHP and MySQL to create the basic "login," "registration," and "account management" functionality seen in many modern Web applications.

View more content in this series

Date:  27 Mar 2007
Level:  Intermediate PDF:  A4 and Letter (447 KB | 30 pages)Get Adobe® Reader®

Activity:  9764 views
Comments:  

Before you start

This tutorial is for Web application developers investigating the XForms Web form processing technology. This tutorial is the first tutorial and second installment of a six-part series. The login form and account registration forms are developed in this tutorial. First, the tutorial will address some of the basics of XForms development including text entry, password obscuring text entry, and the data structures that are required. Then, the tutorial will cover the processing of the XForms data in PHP and the supporting MySQL database structures. The last part of the login is addressing what happens when a login is successful or unsuccessful. A requirement to being able to log in is having an account. The creation of accounts is made possible through a registration process, which is covered after the login.

About this tutorial

The login form is nearly omnipresent throughout the Internet, supporting everything from e-mail access to shopping carts and even online banking. Logging in provides users data customized to their specific account and provides the system a way to control usage. Typical approaches to logging in require the user to enter a username and password that are then authenticated against a database set up prior to the login attempt. This tutorial does not purport to be an example of security in user authentication; instead, it will demonstrate the usage of XForms in the well-known algorithm for logging in and account creation.

Logging in requires the following basic process, and they will be covered in this tutorial:

  1. Enter a username and password into text entry boxes.
  2. Send username and password to authentication service.
  3. Use the given username and account to determine if there is an account with the specified username and password given.
  4. Store the result (true or false) such that all subsequent activities performed by that user are automatically associated with that authentication.
  5. Allow the user access if the login succeeded or deny the user access and provide a message to indicate that the username and password could not be found.

About this series

The purpose of the series is to demonstrate the use of XForms in the development of realistic Web applications and to instruct the reader in the use of XForms.

  • Part 1 is an introduction to the entire series, summarizing all the portions of the end result and what facets of the XForms specification each part covers.
  • Part 2 covers logging in and account management.
  • Part 3 covers the development of forms pertaining to asset management.
  • Part 4 continues the coverage of the development of asset management and reporting of various accounting aspects of a business.
  • Part 5 covers liability management and more enhancements.
  • Part 6 concludes the series with a summary of the developed tools, and some suggestions for improvement and further work for the tool set.

Prerequisites

This tutorial uses a MySQL database for storage and reference. Necessary SQL commands appear throughout the article, but require a working knowledge of MySQL. PHPMyAdmin offers equivalent access to configure the MySQL database and view the entries from a menu-driven graphical interface.

Though the purpose of the series is to educate the reader about the use of XForms, some background knowledge is expected of the reader. There are some very good articles and introductory series concerning XForms available on developerWorks (see Resources). XForms is built on XML, and, hence, a basic understanding of XML is also assumed.

Other technologies and concepts may also be involved, but they will be to a much lesser extent and should be inconsequential to the reader's comprehension of the topic. Some software is also required:

  • A browser capable of displaying XForms, such as Firefox 2.0.1.
  • A Web server with PHP enabled, such as WAMP
  • An SQL server, MySQL, which is part of the WAMP package in this case.

1 of 8 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=XML
ArticleID=204433
TutorialTitle=Use XForms to create an accounting tool, Part 2: Logging in and accounts
publish-date=03272007
author1-email=syakovac@gmail.com
author1-email-cc=