Web Analytics Made Easy -
StatCounter wanting to update. - CodingForum

Announcement

Collapse
No announcement yet.

wanting to update.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • wanting to update.

    hi, i have a members section and each member has a profile. i am trying to create a page where members can update their profile. here is the code i am using to display the members profile with the form that with the fields they can update. I cant get an update code to work with it though. any suggestions. thanks.

    Code:
     <%@LANGUAGE="VBSCRIPT"%> 
    <%
    ' *** Restrict Access To Page: Grant or deny access to this page
    MM_authorizedUsers=""
    MM_authFailedURL="login.asp"
    MM_grantAccess=false
    If Session("MM_Username") <> "" Then
      If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
    		 (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    	MM_grantAccess = true
      End If
    End If
    If Not MM_grantAccess Then
      MM_qsChar = "?"
      If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
      MM_referrer = Request.ServerVariables("URL")
      if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
      MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
      Response.Redirect(MM_authFailedURL)
      Else
      
      'Dimension variables
    Dim adoCon    'Holds the Database Connection Object
    Dim rs	'Holds the recordset for the records in the database
    Dim strSQL   'Holds the SQL query for the database
    
    Set adoCon = Server.CreateObject("ADODB.Connection")
    adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("..\inch.mdb")
    'adoCon.Open "DSN=inch"
    Set rs = Server.CreateObject("ADODB.Recordset")
    
    strSQL = "SELECT * FROM users Where username = '"& Session("MM_username") &"';"
    rs.Open strSQL, adoCon, 3, 3
    
    IF NOT rs.EOF THEN
    
    FName=rs("firstname")
    Femail=rs("email")
    Flname=rs("lastname")
    END IF
    
     rs.Close
    Set rs = Nothing
    adoCon.Close
    Set adoCon = Nothing
    End If
    
    %>
    
    <html>
    <head>
    <title>Members Area - Member profile</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    body {
    scrollbar-arrow-color: white;
    scrollbar-base-color: #000066;
    scrollbar-dark-shadow-color: #000066;
    scrollbar-track-color: #6666FF;
    scrollbar-face-color: #000066;
    scrollbar-shadow-color: #000066;
    scrollbar-highlight-color: #6666FF;
    scrollbar-3d-light-color: #6666FF;
    }
    </style>
    </head>
    <body bgcolor="#6666FF" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
    <form name="form1" method="post" action=""><input type="text" name="firstname" value="<%=fName%>"> 
      <br>
      <input type="text" name="lastname" value="<%=Flname%>">
      <br>
      <input type="text" name="email" value="<%=femail%>">
      <br>
      <input type="submit" name="Submit" value="Update">
    </form>
    <p><font color="#FFFFFF"><b><font size="2" face="Verdana, Arial, Helvetica, sans-serif"></font></b></font> 
    <p>&nbsp;</p>
    
    </body>
    </html>
    Regards,

    Rob Williams

    Website Design Oxford, Web Development Oxfordshire, UK

  • #2
    i have solved it myself!

    Thanks for not answering anyway!
    Regards,

    Rob Williams

    Website Design Oxford, Web Development Oxfordshire, UK

    Comment

    Working...
    X