You need to find the name of the cookie that holds the
value for 'userid' (I accidentally used 'username').
I didn't see it in the code from your previous email,
but this might work:
Change this line:
strUserID = Request.Cookies("username")
To this:
strUserID = Request.Cookies("userID")
If this doesn't work, zip all the files, email them to
me and I will look at them directly.
Mark
--- k4t_9283 <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Thanks for your reply. Ok, I have tried adding your
> code but I'm
> still getting this error:
>
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers
> (0x80040E14)
> [Microsoft][ODBC Microsoft Access Driver] Syntax
> error (missing
> operator) in query expression 'user_id='.
> /kathryn/doCheckout.asp, line 20
>
> Here's my updated page:
>
> <%
> Dim strUserID
> strUserID = Request.Cookies("username")
> If Len(Trim(strUserID)) = 0 Then
> 'Redirect to login page, cookie doesn't exist.
> Response.Redirect("Login.asp")
> End If
>
> Dim strUserName
> strUserName = Request.Cookies("username")
>
>
> ' Retrieve Registration Information
>
> Set Con = Server.CreateObject( "ADODB.Connection" )
> Con.Open "accessDSN"
>
> sqlString = "SELECT * FROM users " &_
> "WHERE user_id=" & userID
> Con.Execute( sqlString )
> IF NOT RS.EOF THEN
> street = RS( "user_street" )
> city = RS( "user_city" )
> county = RS( "user_county" )
> postcode = RS( "user_postcode" )
> country = RS( "user_country" )
> END IF
>
> %>
> <html>
> <head><title>Check Your Address
> Details</title></head>
> <body>
>
> <center>
> <table border=1 width=500
> cellpadding=5 cellspacing=0>
> <tr>
> <td align="center" bgcolor="lightgreen">
> <b>Confirm Order</b>
> </td>
> </tr>
> <tr>
> <td>
> Your order will be sent to the following address
> and charged to the following credit card.
> Please review your address and payment information
>
> and click Confirm Order to finish placing your
> order.
>
> <form method="post" action="checkout2.asp">
> <input name="username" type="hidden"
> value="<%=username%>">
> <input name="password" type="hidden"
> value="<%=password%>">
> <font face="Arial" size="2" color="darkgreen">
> <p><b>Address Information:</b>
> </font>
> <font face="Courier" size="2">
> <br><b>street:</b>
> <input name="street" size=20 maxlength=50
> value="<%=Server.HTMLEncode( street )%>">
> <br><b>city:</b>
> <input name="city" size=20 maxlength=50
> value="<%=Server.HTMLEncode( city )%>">
> <br><b>state:</b>
> <input name="state" size=20 maxlength=2
> value="<%=Server.HTMLEncode( state )%>">
> <br><b>zip:</b>
> <input name="zip" size=20 maxlength=20
> value="<%=Server.HTMLEncode( zip )%>">
> </font>
> <p><input type="submit" value="Confirm Order">
> </font>
> </form>
> </tr>
> </table>
>
> <p>
>
>
> --- In [email protected],
> Mark E
> <[EMAIL PROTECTED]> wrote:
> > Try putting this at the top of your doCheckout or
> the
> > page name that's not retreiving the user name:
> >
> > Dim strUserName
> > strUserName = Request.Cookies("username")
> >
> > Then your SQL statement should populate with the
> > username.
> >
> > Also, you will need to add code to check for the
> > existance of the cookie. The user may delete it
> or it
> > may expire and you would be stuck in the same
> > situation.
> >
> > So before you do anything, check for a cookie
> value:
> >
> > Dim strUserID
> > strUserID = Request.Cookies("username")
> > If Len(Trim(strUserID)) = 0 Then
> > 'Redirect to login page, cookie doesn't exist.
> > Response.Redirect("Login.asp")
> > End If
> >
> > '*** continue with your existing code...
> >
> > Mark
>
>
>
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/