Consultor Eletrônico



Kbase P5696: How and where to place cookie code within the post code?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   2/5/2003
Status: Unverified

GOAL:

How and where to place cookie code within the post code?

GOAL:

How to pass (subset of information) record information when moving inbetween screens?

FACT(s) (Environment):

WebSpeed 3.x

FIX:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<Title>An Example of A Logon Screen</title>
<head>
<meta name="AUTHOR" content="Alex Pearlstein">
<script language="SpeedScript">
def var logon as Character.
def var password as Character.
def var WrongPW as logical init true.


PROCEDURE output-headers:
/*Gets the fill-ins values*/
assign logon = get-value("logon").
Assign password = get-value("password").
/*Does the security check*/
/*Note that we check to make sure the submit button*/
/*was pressed so we don't perform a check upon load of the page*/
IF get-value("SubmitBtn") = "Submit" THEN do:
Find first Salesrep where SalesRep = logon and salesrep = password
no-error.
/*If the security check passes where to redirect to*/
IF available salesrep THEN do:
/*This Method is redirecting to a new site.*/
/*You may call a separate page instead using the RUN statement*/
/*Cookies would also be set in this block if needed*/
OUTPUT-HTTP-HEADER("Status","302").
OUTPUT-HTTP-HEADER("Location","http://www.Progress.com").
OUTPUT-HTTP-HEADER("","").
END.
/*In case the Security Check fails*/
Else
Assign WrongPW = false.

END.

END PROCEDURE.

</script>
</head>

<body>
<Form method="Post" action="logon.html">
<h1><center><b>Customer Login</center></b></h1>
<center>
<table border="0" cellpadding="2" cellspacing="0" bgcolor="white">
<TR>
<TD><Font size="4">Logon</TD>
<TD>
<input type="text" size="20" name="logon" value=`logon`>
</TD>
</TR>
<TR>
<TD><Font size="4">Password</TD>
<TD><input type="password" size="20" name="password"></TD>
</TR>

<!-- The Go Button -->
<TR>
<TD colspan="2"><center>
<input type="submit" name="SubmitBtn" value="Submit">
</center></td>
</TR>

<script language="SpeedScript">
/*Conditionally Displayed line to identify incorrect information*/
If WrongPW = false and get-value("SubmitBtn") = "Submit" then
{&out} ' <TR>'
' <TD colspan="2">'
'<Center><Font color="RED">Sorry that is the incorrect logon</TD>'
' </TR>'.
</script>
</center>
</Table>
<BR><BR>
<BR><Center>This example uses Sales Rep's names for both fields.
<BR><Center>A proper logon would be HXM for both fields.
</body>
</html>