Hi there

I have the same book andi have been having the same problems as you are having 
now

I wonder if there is an erorr in the actula code in the book as i have been 
sturggling with that code.

Rich
  ----- Original Message ----- 
  From: k4t_9283 
  To: [email protected] 
  Sent: Sunday, May 01, 2005 10:02 AM
  Subject: [AspClassicAnyQuestionIsOk] Re: Desperately need help! Value not 
being retrieved!


  I declare the variable 'username' in the registration page. And I 
  have just double-checked the database and there are definately values 
  in there.

  This is the register page:

  ====================================================================

  <%
  newusername = TRIM( Request( "newusername" ) )
  Session("username") = newusername
  newpassword = TRIM( Request( "newpassword" ) )
  user_id = TRIM( Request( "userID" ) )
  title = TRIM( Request( "title" ) )
  firstName = TRIM( Request( "firstname" ) )
  surname = TRIM( Request( "surname" ) )
  gender = TRIM( Request( "gender" ) )
  email = TRIM( Request( "email" ) )
  telephone = TRIM( Request( "telephone" ) )
  street = TRIM( Request( "street" ) )
  city = TRIM( Request( "city" ) )
  county = TRIM( Request( "county" ) )
  postcode = TRIM( Request( "postcode" ) )
  country = TRIM( Request( "country" ) )
  cctype = Request( "cctype" )
  ccnumber = TRIM( Request( "ccnumber" ) )
  ccexpires = TRIM( Request( "ccexpires" ) )
  ccname = TRIM( Request( "ccname" ) )

  submitpage = Request.ServerVariables( "SCRIPT_NAME" )
  %>

  <html>
  <head><title>Register</title></head>
  <body bgcolor="white">

  <center>

  <table width=975 border=0 cellspacing=0 cellpadding=0>
  <tr>
  <td>
  <img src="bookworms.gif" alt="Bookworms Bookshop Logo">
  </td>
  </tr>
  </table>
  <p>

  <table width="500" border=0
    cellpadding=4 cellspacing=0>

  <tr>
    <td colspan=2 bgcolor="lightgreen">
    <font color="darkgreen" face="Arial">
    <b>Existing Customers - Login</b>
    </font>
    </td>
  </tr>

  <tr>
    <td colspan=2>

    <form method="post" action="<%=submitpage%>">
    <input name="login" type="hidden" value="1">
    <input name="pid" type="hidden" value="<%=productID%>">
    <font face="Arial" size="2">
    Please enter your username and password:
    </font>
  </td>
  </tr>

  <tr>
  <td>
    <font face="Arial" size="2"> 
    <p><b>Username:</b>  
  </td>
  <td>
    <input name="username" size="20"></b>
  </td>
  </tr>

  <tr>
  <td>
  <font face="Arial" size="2">
    <br><b>Password:</b>
  </font>
  </td>
  <td>
    <input name="password" size="20"></b>
  </td>
  </tr>
  <tr>
  <td colspan=2 align="right">
    <input type="submit" value="Login">
    </font>
  </td>
  </tr>  
  </form>
  </table>

  <p>
  <p>
  <p>
  <p>
  <table width="500" border=0
    cellpadding=4 cellspacing=0>
  <tr>
    <td bgcolor="lightgreen" colspan=2>
    <font color="darkgreen" face="Arial">
    <b>New Customer Registration Information</b>
    </font>
    </td>
  </tr>

  <tr>
    <td colspan=2>
    <form method="post" action="<%=submitpage%>">
    <input name="register" type="hidden" value="1">
    <input name="pid" type="hidden" value="<%=productID%>">
    <font face="Arial" size="2">
    If you are a new user, please register by completing the following 
  form:
    <p>
    </font>
  </td>
  </tr>

  <tr>
  <td colspan=2>
    <font face="Arial" size="2" color="darkgreen">
    <p><b>Login Information:</b></font>
  </td>
  </tr>
  <tr>
  <td colspan=2>
    <font face="Arial" size="2">
    Please select a username and password:
  </td>
  </tr>

  <tr>
  <td>
    <font face="Arial" size="2">
    <b>Username:</b>
    </font>
  </td>
  <td>
    <input name="newusername" size=20 maxlength=20
      value="<%=Server.HTMLEncode( newusername )%>">
  </td>
  </tr>

  <tr>
  <td>
  <font face="Arial" size="2">
    <b>Password:</b>
  </td>
  <td>
    <input name="newpassword" size=20 maxlength=20
      value="<%=server.HTMLEncode( newpassword )%>">
  </td>
  </tr>

  <tr>
  <td colspan=2>
    <font face="Arial" size="2" color="darkgreen">
    <p>
    <b>Personal Information:</b>
    </font>
  </td>
  </tr>

  <tr>
  <td>
    <font face="Arial" size="2"> 
    <b>Title:</b>  
    </font>
  </td>
  <td>
    <input name="title" size=10 maxlength=10
      value="<%=Server.HTMLEncode( user_title )%>">
  </td>
  </tr>

  <tr>
  <td>
  <font face="Arial" size="2">
    <b>First Name:</b> 
  </td> 
  <td>
    <input name="firstname" size=30 maxlength=30
      value="<%=Server.HTMLEncode( user_firstName )%>">
  </td>
  </tr>

  <tr>
  <td>
  <font face="Arial" size="2">
    <b>Surname:</b> 
  </td>
  <td>
    <input name="surname" size=30 maxlength=30
      value="<%=Server.HTMLEncode( user_surname )%>">
  </td>
  </tr>

  <tr>
  <td>
  <font face="Arial" size="2">
    <b>Gender:</b>  
  </td>
  <td>
  <font face="Arial" size="2">
    <input type=radio name="gender" value="Male">Male
    <input type=radio name="gender" value="Female">Female
  </td>
  </tr>

  <tr>
  <td>
  <font face="Arial" size="2">
    <b>Email address:</b> 
  </td>
  <td> 
    <input name="email" size=30 maxlength=75
      value="<%=Server.HTMLEncode( email )%>">
  </td>
  </tr>

  <tr>
  <td>
  <font face="Arial" size="2">
    <b>Telephone Number:</b>  
  </td>
  <td>
    <input name="telephone" size=30 maxlength=30
      value="<%=Server.HTMLEncode( telephone )%>">
    </font>
  </td>
  </tr>

  <tr>
  <td colspan=2>
    <font face="Arial" size="2" color="darkgreen">
    <p>
    <b>Address Information:</b>
    </font>
  </td>
  </tr>

  <tr>
  <td>
    <font face="Arial" size="2">
    <b>Street:</b>
  </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>
  </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>
  </td>
  <td>
    <input name="county" size=20 maxlength=20
     value="<%=Server.HTMLEncode( county )%>">
  </td>
  </tr>

  <tr>
  <td>
  <font face="Arial" size="2">
    <b>Postcode:</b>
  </td>
  <td>
    <input name="postcode" size=8 maxlength=8
     value="<%=Server.HTMLEncode( postcode )%>">
  </td>
  </tr>

  <tr>
  <td>
  <font face="Arial" size="2">
    <b>Country:</b>
  </td>
  <td>
    <input name="country" size=20 maxlength=30
     value="<%=Server.HTMLEncode( country )%>">
  </td>
  </tr>

  <tr>
  <td colspan=2>
    <font face="Arial" size="2" color="darkgreen">
    <p>
    <b>Payment Information:</b>
    </font>
  </td>
  </tr>

  <tr>
  <td>
  <font face="Arial" size="2">
    <b>Type of credit card:</b>
  </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 Expiry Date:</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>

  </font>

  <tr>
  <td colspan=2 align="right">
    <input type="submit" value="Register">
  </td>
  </tr>
    </form> 

  </table>

  </body>
  </html>
  ==================================================================

  But I am just wondering whether because the value of the Session 
  is 'newusername', would that mean that only new users' usernames 
  would be captured?

  Ok, I think the best thing to do is as you suggested in an earlier 
  post. I'll zip the files that are related and email you them. My 
  project is due in on Wednesday, but I really need to get this all 
  working by Tuesday at the latest!!



  > 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






------------------------------------------------------------------------------
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
      
    b.. To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]
      
    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



[Non-text portions of this message have been removed]



 
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/
 



Reply via email to