Is this all your code? It looks like there is some
code missing. For example, you are setting your
session with this line:
Session( "username" ) = username
But I don't see you declaring the variable 'username'.
Or where it gets its value.
I suspect that the reason your values aren't being
displayed on the form is that the recordset is empty
and there are no values present. Also, I don't see
the variables being declared. And (sorry, I know this
is getting kinda long), you really need to trap the
session value. If your session times out, you need to
handle that. Ditto for an empty recordset. If no
values are returned from your database, you need to
know and display some sort of message to the customer.
Mark
--- k4t_9283 <[EMAIL PROTECTED]> wrote:
> Ok, I've re-juggled the code so that it scraps the
> idea of a cookie and
> is using a session. I decided that seeing as
> username is unique anyway,
> I would try and work with that, seeing as it is
> passed from page to
> page anyway.
>
> So I finally got the page to load which is great,
> but the values in the
> form aren't loading!
>
> Here's my updated page:
>
>
======================================================================
>
> <%
> ' Store userID in Session variable
>
> Session( "username" ) = username
>
>
> ' Retrieve Registration Information
>
> Set Con = Server.CreateObject( "ADODB.Connection" )
> Con.Open "accessDSN"
>
> sqlString = "SELECT * FROM users " &_
> "WHERE user_username='" & Session("username") &
> "'"
>
> SET RS = 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" )
> cctype = RS( "user_cctype" )
> ccnumber = RS( "user_ccnumber" )
> ccexpires = RS( "user_ccexpires" )
> ccname = RS( "user_ccname" )
> END IF
>
> ' Hide Credit Card Number
> ccnumber = LEFT( ccnumber, 2 ) &_
> "************" &_
> RIGHT( ccnumber, 2 )
> %>
> <html>
> <head><title>Checkout - Confirm your Address and
> Payment
> Details</title></head>
> <body>
>
> <center>
>
> <table border=0 width=500
> cellpadding=5 cellspacing=0>
> <tr>
> <td align="center" colspan=2 bgcolor="lightgreen">
> <font face="Arial" size="3">
> <b>Confirm Your Details</b>
> </font>
> </td>
> </tr>
> <tr>
> <td colspan=2>
> <font face="Arial" size="2">
> 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>
> </td>
> </tr>
> <tr>
> <td colspan=2>
> <font face="Arial" size="2" color="darkgreen">
> <b>Address Information:</b>
> </font>
> </td>
> </tr>
> <tr>
> <td>
> <font face="Arial" size="2">
> <b>Street:</b>
> </font>
> </td>
> <td>
> <input name="street" size=20 maxlength=50
> value="<%=Server.HTMLEncode( street )%>">
> </td>
> </tr>
> <tr>
> <td>
> <font face="Arial" size="2">
> <b>City:</b>
> </font>
> </td>
> <td>
> <input name="city" size=20 maxlength=50
> value="<%=Server.HTMLEncode( city )%>">
> </td>
> </tr>
> <tr>
> <td>
> <font face="Arial" size="2">
> <b>County:</b>
> </font>
> </td>
> <td>
> <input name="county" size=20 maxlength=2
> value="<%=Server.HTMLEncode( county )%>">
> </td>
> </tr>
> <tr>
> <td>
> <font face="Arial" size="2">
> <b>Postcode:</b>
> </font>
> </td>
> <td>
> <input name="postcode" size=20 maxlength=20
> value="<%=Server.HTMLEncode( postcode )%>">
> </td>
> </tr>
> <tr>
> <td>
> <font face="Arial" size="2">
> <b>Country:</b>
> </font>
> </td>
> <td>
> <input name="country" size=20 maxlength=2
> value="<%=Server.HTMLEncode( country )%>">
> </td>
> </tr>
> <tr>
> <td colspan=2>
> <font face="Arial" size="2" color="darkgreen">
> <b>Payment Information:</b>
> </font>
> </td>
> </tr>
> <tr>
> <td>
> <font face="Arial" size="2">
> <b>Type of Credit Card:</b>
> </font>
> </td>
> <td>
> <select name="cctype">
> <option value="Visa">Visa</option>
> <option value="Mastercard">MasterCard</option>
> <option value="Switch">Switch</option>
> </select>
> </td>
> </tr>
> <tr>
> <td>
> <font face="Arial" size="2">
> <b>Credit Card Number:</b>
> </font>
> </td>
> <td>
> <input name="ccnumber" size=20 maxlength=20
> value="<%=Server.HTMLEncode( ccnumber )%>">
> </td>
> </tr>
> <tr>
> <td>
> <font face="Arial" size="2">
> <b>Credit Card Expires:</b>
> </font>
> </td>
> <td>
> <input name="ccexpires" size=20 maxlength=20
> value="<%=Server.HTMLEncode( ccexpires )%>">
> </td>
> </tr>
> <tr>
> <td>
> <font face="Arial" size="2">
> <b>Name on Credit Card:</b>
> </font>
> </td>
> <td>
> <input name="ccname" size=20 maxlength=20
> value="<%=Server.HTMLEncode( ccname )%>">
> </td>
> </tr>
> <tr>
> <td colspan=2>
>
=== message truncated ===
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/