[Top] [Prev] [Next] [Bottom] [Contents]

Example: Logging In and Frames

This is a very small demonstration of how to enable an application to login to a database and also use frames at the same time. All the frames are logged in because login happens before the frames are generated.

Below is a schematic of the project that you will build here.

When you look at the listing of the HTML of the login screen on the next page, you will notice that the two items that are returned by the form are given the names "SALOGIN" and "SAPASSWORD". These may considered as being keywords for Sapphire/Web; the values associated with them are retained by the server application and used automatically whenever a username and password are subsequently required. Other settings in the options editor - specifically Use Common Login and Use Native OS Login - determine which login requests should be satisfied by these strings and which should be passed out to the user.

Preparation

Login Screen

Create a new document (home.html). For a template, use loginform.html from the list of available templates. The code is this, although we have added a title.

<HTML>
<HEAD><TITLE>Frame Login Demo</TITLE></HEAD>
<BODY>
<H5>Please Login:</H5>
<FORM ACTION="loginform" METHOD="post" >
<INPUT TYPE="INPUT" NAME="SALOGIN" VALUE=""><BR>
<INPUT TYPE="PASSWORD" NAME="SAPASSWORD" VALUE=""><BR>
<INPUT TYPE="SUBMIT" VALUE="Submit">
<INPUT TYPE="RESET" VALUE="Reset"><BR>
</FORM>
</BODY>
</HTML>

Frameset Form

Create this form, called frameset.html (use the default style), which will be linked to by the login form, and create your frameset in it. You use activators instead of HTML URLs to define the HTML documents in the frameset.

<HEAD>
<TITLE>Frame Login Demo</TITLE>
</HEAD>
	<FRAMESET rows="20%,*">
		<FRAME src="topframe" name="topframe">
		<FRAME src="bottomframe" name="bottomframe"> 
	</FRAMESET>
<body>
	<noframes><center> 
		Sorry.<br> This page has frames<br>
	</center></noframes> 
</body>
</html>

Display Forms

We use two display forms, one for each of the two frames. These are called top.html and bottom.html and are created using the Sapphire/Web-supplied default.html template with a data drop site added to each (##Sa_Top## and ##Sa_Bottom## respectively).

Bindings

Results

Here you can see that both frames are showing (different) data, and the application is logged in.

If login had failed, error messages would show in each of the frames.




[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.