Login username to be posted in access database

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

peachmelba

Thread Starter
Joined
Jan 2, 2006
Messages
1
Hi there.
Forgive me my poor english. Normally i speak danish :)
I have a asp problem. I have created a little bet site.
I want the user to log in with username and password and make the bets. These bets are to be written in a access database.
I have found a login script that i use, and i have created a form that writes the bets in a database.
My question is: How do i get the username in the access database along with the bets.
You can watch the site here:

http://www.side4.dk/logon6/login.asp
land log in with:
username: nnnnn
password: nnnnn

The code where you deliver bets is looking like this:

Many thanx

<%
' FP_ASP ASP Automatically generated by a FrontPage Component. Do not Edit.

On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 1252
Err.Clear

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear

Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"

Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"

fp_conn.Open Application("afgivtip_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"

fp_rs.Open "Resultater", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"

fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(5)
Dim arFormDBFields0(5)
Dim arFormValues0(5)

arFormFields0(0) = "kamp1"
arFormDBFields0(0) = "kamp1"
arFormValues0(0) = Request("kamp1")
arFormFields0(1) = "kamp2"
arFormDBFields0(1) = "kamp2"
arFormValues0(1) = Request("kamp2")
arFormFields0(2) = "kamp3"
arFormDBFields0(2) = "kamp3"
arFormValues0(2) = Request("kamp3")
arFormFields0(3) = "kamp4"
arFormDBFields0(3) = "kamp4"
arFormValues0(3) = Request("kamp4")
arFormFields0(4) = "kamp5"
arFormDBFields0(4) = "kamp5"
arFormValues0(4) = Request("kamp5")

FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0

If Request.ServerVariables("REMOTE_HOST") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"), "Navn_på_fjerncomputer"
End If
If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"), "Webbrowsertype"
End If
FP_SaveFieldToDB fp_rs, Now, "Tidsstempel"
If Request.ServerVariables("REMOTE_USER") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_USER"), "Brugernavn"
End If

fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"

fp_rs.Close
fp_conn.Close

FP_FormConfirmation "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"memberpage.asp",_
"Return to the form."

End If
End If

Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")

%>

<%
session.Timeout = 50
' set timeout in Minute
loginstatus = session("login")
loginname = session("name")

if loginstatus = "yes" then
%>


<!--you HTml-->
<center><font face="Verdana" size="2">Hej <b><%=loginname%></B> , Du er logget
ind i tipsområdet!!<br>
&nbsp;</font><form method="POST" name="FrontPage_Form1" action="--WEBBOT-SELF--" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript">
<!--webbot bot="SaveDatabase" SuggestedExt="asp" S-DataConnection="afgivtip" S-RecordSource="Resultater" U-Database-URL="../fpdb/afgivtip.mdb" S-Builtin-Fields="REMOTE_HOST HTTP_USER_AGENT Timestamp REMOTE_USER" S-Builtin-DBFields="Navn_på_fjerncomputer Webbrowsertype Tidsstempel Brugernavn" S-Form-Fields="kamp1 kamp2 kamp3 kamp4 kamp5" S-Form-DBFields="kamp1 kamp2 kamp3 kamp4 kamp5" U-ASP-Include-Url="../_fpclass/fpdbform.inc" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--#include file="../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" i-checksum="34604" endspan -->
<p>Så skal der tippens !!! Tip 1 for hjemmesejer, X for uafgjort og 2 for
udesejr</p>
<p>Hvordan ender kampen&nbsp;&nbsp;
<!--webbot bot="Validation" s-display-name="Tip her" b-value-required="TRUE" b-disallow-first-item="TRUE" -->
<select size="1" name="kamp1">
<option value="Tip her">Tip her</option>
<option value="1">1</option>
<option value="X">X</option>
<option value="2">2</option>
</select></p>
<p>Hvordan ender kampen&nbsp;&nbsp;
<!--webbot bot="Validation" s-display-name="Tip her" b-value-required="TRUE" b-disallow-first-item="TRUE" -->
<select size="1" name="kamp2">
<option value="Tip her">Tip her</option>
<option value="1">1</option>
<option value="X">X</option>
<option value="2">2</option>
</select></p>
<p>Hvordan ender kampen&nbsp;&nbsp;
<!--webbot bot="Validation" s-display-name="Tip her" b-value-required="TRUE" b-disallow-first-item="TRUE" -->
<select size="1" name="kamp3">
<option value="Tip her">Tip her</option>
<option value="1">1</option>
<option value="X">X</option>
<option value="2">2</option>
</select></p>
<p>Hvordan ender kampen&nbsp;&nbsp;
<!--webbot bot="Validation" s-display-name="Tip her" b-value-required="TRUE" b-disallow-first-item="TRUE" -->
<select size="1" name="kamp4">
<option value="Tip her">Tip her</option>
<option value="1">1</option>
<option value="X">X</option>
<option value="2">2</option>
</select></p>
<p>Hvordan ender kampen&nbsp;&nbsp;
<!--webbot bot="Validation" s-display-name="Tip her" b-value-required="TRUE" b-disallow-first-item="TRUE" -->
<select size="1" name="kamp5">
<option value="Tip her">Tip her</option>
<option value="1">1</option>
<option value="X">X</option>
<option value="2">2</option>
</select></p>
<p><input type="submit" value="Send" name="B1"><input type="reset" value="Nulstil" name="B2"></p>
</form>

<p>&nbsp;</p>
<p><font face="Verdana" size="2">
<br><br>
&nbsp;</p>
</center>




</font>




<%
else
Response.Redirect "login.asp"
end if
%>
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top