Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Retrieve Name Value to Display in Confirmation Page
Old 06-09-2006, 10:21 AM Retrieve Name Value to Display in Confirmation Page
Average Talker

Posts: 25
Trades: 0
Hi,
Firstly, sorry for asking for assistance for such a basic question :-)

I have created a User Registration page, but I am having difficulty displaying the name of the person who has registed in my confirmation page...code is as follows:

Code:
<%@ LANGUAGE="VBSCRIPT" %>
<%response.buffer=true%>
<!--#include file="adovbs.inc"-->
<!--#include file="global.asa"-->
<%
'------------------------------------------------------------
'Change Control : 
'Change no : 1
'Date :  Mar 2006
'Author :Lynn Howard
'Description : send registation details to tblID
'************************************************************ 
 
%>
<!--Change Control Form Entry; 25/4/2006 -->
<head>
<title>Change Control Registration</title>
 
</head>
<body link="#000000" alink="#000000" vlink="#000000" background="http://www.webmaster-talk.com/images/wallpaper2.gif" >
 
<center>
<h2><img src="http://www.webmaster-talk.com/images/deault_01.jpg"></h2>
<h2><font face="Sky InfoText Bd" color="#0388BB" size="6">
CHANGE CONTROL REGISTRATION</font></h2>
 
<%
 Response.Buffer = true
%>
<%
'-- Check if Submit button pushed, if not ignore the entire script
If Request.Form("btnAdd") = "Submit" Then
'-- Make sure all boxes have data entered into them
If Request.Form("name") <> "" OR Request.Form("password1") <> "" OR Request.Form("password2") <> "" OR Request.Form("email") <> "" OR Request.Form("userID") <> "" Then
'-- Make sure the passwords match
If Request.Form("password1") = Request.Form("password2") Then
'-- Declare your variables
Dim Conn, cmdDC, RS, SQL, strError
Dim strUserName, strPassword, strEmail, strUserID
'-- Get data from the form fields
strUserName = Request.Form("name")
strPassword = Request.Form("password1")
strEmail = Request.Form("email")
strUserID = Request.Form("userID")
'-- Create object and open database
SET conn = Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/inetpub/wwwroot/change control.mdb"
 
Set cmdDC = Server.CreateObject("ADODB.Command")
cmdDC.ActiveConnection = Conn
'-- default SQL
SQL = "SELECT * FROM tblID"
If Request.Form("name") <> "" Then 
  SQL = "SELECT tblID.* FROM tblID WHERE tblID.userID='" & strUserID & "' AND tblID.password1 ='" & strPassword & "' OR tblID.email ='" & strEmail & "'"
 
End If
cmdDC.CommandText = SQL
cmdDC.CommandType = 1
Set RS = Server.CreateObject("ADODB.Recordset")
'-- Cursor Type, Lock Type
'-- ForwardOnly 0 - ReadOnly 1
'-- KeySet 1 - Pessimistic 2
'-- Dynamic 2 - Optimistic 3
'-- Static 3 - BatchOptimistic 4
 
RS.Open cmdDC, , 0, 2
'-- check to see if the user and password or e-mail address have registered before
If Not RS.EOF Then
 
 If RS.fields("email")=strEmail Then
  strError = "<FONT FACE='ARIAL' SIZE='2'><B>Sorry this email has already been registred, please try again</B></FONT>"
 
 Else
 
  'Redo page and say 'this User name and Password are already taken
  strError = "<FONT FACE='ARIAL' SIZE='2'><B>Sorry this user name and password are already taken, please try again</B></FONT>"
 End If
 
Else
 '-- Add new record to the database
 Dim dataConn, sSQL
    SET dataconn = Server.CreateObject("ADODB.Connection")
 dataconn.Provider="Microsoft.Jet.OLEDB.4.0"
 dataconn.Open "c:/inetpub/wwwroot/change control.mdb"
 sSQL = "INSERT INTO tblID(name, email, userID, password1, userlevel) VALUES ('" & strUserName & "','" & strEmail & "','" & strUserID & "','" & strPassword & "',0)"
 dataconn.Execute sSQL
 dataconn.Close
 Set dataconn = Nothing
 'Forward the user to page to notify of authentication
 Response.Redirect "Registered.asp"
End If
Else
 strError = "Your passwords don't match"
 
End If
 '-- Close all connections
 RS.Close
 Set RS = Nothing
 Conn.Close
 Set Conn = Nothing
Else
 'Tell them what they entered wrong
 strError = "Please fill in all the boxes"
 
End If
End If
%>
<!-- HTML FORM -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<BODY bgcolor="#FFFFFF" MARGINHEIGHT="0" MARGINWIDTH="0" LEFTMARGIN="0" TOPMARGIN="0" TEXT="#000000">
<%
  '-- Error message if there is any     
  Response.write (strError & "<BR>")
 
%>
 
<form method="POST" action="registration1.asp">
                          <div align="center">
                            <table border="0" cellpadding="3" cellspacing="3" width="520" style="border-collapse: collapse" bordercolor="#111111">
                              <tr>
                              <td bgcolor="#260063" width=161 align="center" >
   <p align="left">
   <font face="Sky InfoText Bd" color="#ffffff">Full Name:</font><font face="Sky InfoText Bd">
            </font>
  </td>
  <td width=1 align="center"> 
   <input type=text name="name" size="50">
   </td>
  </tr>
  <tr>
                              <td bgcolor="#260063" width=161 align="center" >
   <p align="left">
   <font face="Sky InfoText Bd" color="#ffffff">User ID:</font><font face="Sky InfoText Bd">
            </font>
  </td>
  <td width=1 align="center"> 
   <input type=text name="UserID" size="50">
   </td>
  </tr>
 
                              <td bgcolor="#260063" width=161 align="center" >
   <p align="left">
   <font face="Sky InfoText Bd" color="#ffffff">Email:</font><font face="Sky InfoText Bd">
            </font>
  </td>
  <td width=1 align="center"> 
   <input type=text name="email" size="50">
   </td>
  </tr>
                              <td bgcolor="#260063" width=161 align="center" >
   <p align="left">
   <font face="Sky InfoText Bd" color="#ffffff">Password:</font><font face="Sky InfoText Bd">
            </font>
  </td>
  <td width=1 align="center"> 
   <input type="password" name="password1" size="50">
   </td>
  </tr>
                              <td bgcolor="#260063" width=161 align="center" >
   <p align="left">
   <font face="Sky InfoText Bd" color="#ffffff">Confirm Password:</font><font face="Sky InfoText Bd">
            </font>
  </td>
  <td width=1 align="center"> 
   <input type="password" name="password2" size="50">
   </td>
  </tr>
 
 
                              </tr>
                            </table>
                          </div>
                          <p><input type="submit" value="Submit" name="btnAdd"><input type="reset" value="Reset" name="B2"></p>
                        </form>
</body>
</html>

I would then like to confirm that Registration is complete, but am having trouble confirming the Name value.
I have tried different variations....

Code:
<%
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/inetpub/wwwroot/change control.mdb"
set rs=Server.CreateObject("ADODB.recordset")
 
Dim StrName
StrUserName = Request.Form("Name")
%>
<CENTER><H2>
<font face="Sky InfoText Bd" color="#0388BB">Thank you <% = StrUserName %>, 
email confirmation will be sent to you shortly.</font></H2>
<%
Conn.Close
%>
I have tried Response.Write"StrUserName",<%Request.Form("Name") %> and <%"StrUserName"%> as well as opening the recordset with a SQL stamement and selecting by Request.Form("Name").
I'm sure there is a very simple solution to this and would appreciate any help!
Thanks,
Lynn

Last edited by devine; 06-09-2006 at 10:35 AM..
devine is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-09-2006, 04:08 PM Re: Retrieve Name Value to Display in Confirmation Page
ExpressoDan's Avatar
Ultra Talker

Posts: 317
Name: This Space for Rent
Location: Georgia
Trades: 0
Request.Form is not going to work as you are not sending that information to the next page, do this. add the information to your url you are redirecting to and request the variables on the next page through that.

Code:
Response.Redirect("Registered.asp?name="&Request.Form("name"))
On the next page do this

Code:
Thank you <%=Request("name")%>
__________________

Please login or register to view this content. Registration is FREE

"I think therefore I am, I think." <!-- George Carlin
ExpressoDan is offline
Reply With Quote
View Public Profile Visit ExpressoDan's homepage!
 
Old 06-09-2006, 06:04 PM Re: Retrieve Name Value to Display in Confirmation Page
Average Talker

Posts: 25
Trades: 0
Thank you ExpressoDan.
Your code was spot on - I did post this on a few other forums, but no-one else had given detailed coding.
Once again, many thanks!
Lynn
devine is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Retrieve Name Value to Display in Confirmation Page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.84928 seconds with 12 queries