1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Login username to be posted in access database

Discussion in 'Web Design & Development' started by peachmelba, Jan 2, 2006.

Thread Status:
Not open for further replies.
  1. peachmelba

    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
    %>
     
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 733,556 other people just like you!

Loading...
Similar Threads - Login username posted
  1. rubsanjida
    Replies:
    1
    Views:
    188
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/430263

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice