Consultor Eletrônico



Kbase P17284: Example of passing Values in URLs in Webspeed
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   25/11/2003
Status: Unverified

GOAL:

Example of passing Values in URLs in Webspeed

FACT(s) (Environment):

WebSpeed 3.x

FIX:

Save and compile these 2 files in your work directory
---------------------------logon.html----------------------------------------
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<META NAME="AUTHOR" CONTENT="Your Name">
<TITLE>WebSpeed Script</TITLE>
<SCRIPT LANGUAGE="SpeedScript">
/* Create an unnamed pool to store all the widgets created by this procedure.
This is a good default which assures that this procedure's triggers and
internal procedures will execute in this procedure's storage, and that
proper cleanup will occur on deletion of the procedure. */
CREATE WIDGET-POOL.

Def var username as c no-undo.
def var userpw as c no-undo.
def var errormsg as c no-undo.

PROCEDURE output-headers:
If get-value("uid") = "Homer" and get-value("UPW") = "Simpson" then do:
OUTPUT-HTTP-HEADER("Status","302").
OUTPUT-HTTP-HEADER("Location","entry.html?uid=" + get-value('uid')).
OUTPUT-HTTP-HEADER("","").
END.

Else
IF get-value("uid") GT " " THEN
Assign errormsg = "Sorry UserID & Password did not match".
END PROCEDURE.
</SCRIPT>
</HEAD>

<BODY>
<SCRIPT LANGUAGE="SpeedScript">
/*------------------------------------------------------------------
File:
Description:
Created:
-------------------------------------------------------------------*/

</SCRIPT>
<Center>
<Form method="POST" Name="logon" action="logon.html">
<table>
<TR><TD>User</TD><TD><input type="text" size="20" name="uid" value=""></TD></TR>
<TR><TD>Password</TD><TD><input type="text" size="20" name="upw" value=""></TD></TR>
</table>
<BR>
<Font color = "red">`errormsg` </Font>
<BR>
<input type="submit" name="action" value="Logon">

</form>
</BODY>
</HTML>

------------------------------------------------------------------------------

-----------------------------entry.html---------------------------------------
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<META NAME="AUTHOR" CONTENT="Your Name">
<TITLE>WebSpeed Script</TITLE>
<SCRIPT LANGUAGE="SpeedScript">
/* Create an unnamed pool to store all the widgets created by this procedure.
This is a good default which assures that this procedure's triggers and
internal procedures will execute in this procedure's storage, and that
proper cleanup will occur on deletion of the procedure. */
CREATE WIDGET-POOL.
</SCRIPT>
</HEAD>

<BODY>
<SCRIPT LANGUAGE="SpeedScript">
/*------------------------------------------------------------------
File:
Description:
Created:
-------------------------------------------------------------------*/
def var username as c no-undo.
Assign username = get-value("UID").


{&out} 'hello ' + username.
</SCRIPT>
</BODY>
</HTML>

------------------------------------------------------------------------------