<html>
<head></head>
<body>
<form action="login.wbsp" method="post">
Please enter your log-in information:<br />
Username <input type="text" name="username" /><br />
Password <input type="password" name="password" /><br />
<input type="submit" value="Login" />
</form>
</body>
</html>
<html>
<head></head>
<body>
Hello $wbgets[username],<br />
you are logged in!
</body>
</html>
[FormFields]
WB_UseSessions=T
#* Use sessions in this page *#
<!--WB_BeginTemplate-->
$wbif["$wbgets[logged]"="1"| #* check if we have a session variable logged and have a value 1 *#
$wbrinc[secured.ic] #* if yes, show the secured page, the user is logged in *#
|
$wbrinc[login.ic] #* if not, show the log-in form, the user is not logged in *#
]
[FormFields]
WB_UseSessions=T
#* We need sessions *#
WB_command=Q
#* Query the DB *#
WB_BaseName=reg.mdb
#* connect to red.mdb DB file*#
WB_RcdSet=profile
#* use profile table for our query*#
WB_Query=username='$wbv{username}' and password='$wbv{password}'
#* get all records which have this username and this password in the same time *#
WB_MaxRec=1
#* one record is enough *#
[MsgAndLbl]
WBM_NoMatch=$empty$
<!--WB_BeginTemplate-->
<html>
<head></head>
<body>
$wbif[$wbp[RC]=1| #* if we have match we will have one record *#
$wbsets[logged|1|f] #* set logged as 1 *#
$wbsets[username|$wbv[username]|f] #* set username with the username provided *#
You have been successfully logged in, please click <a href="default.wbsp">here</a> to return to your page.
|
Your username and password does not match, please go back and try again!
]
</body></html>
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)