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
Making the User Name be the Email Address
Old 01-02-2008, 12:19 AM Making the User Name be the Email Address
Extreme Talker

Posts: 216
Trades: 0
I'm using an asp membership script that has a Registration Page with an Email Address field, User Name field, Password field and Password Confirmation field, etc.

I'd like to get help making it so the registrar has to put his Email Address as his User Name. So I'd like to make the User Name field the Email Address field and the Email Address field the Email Address Confirmation field.

Can you help me with this? The Registration page code is a little longer in length than this Forum allows, so I've attached it as a text file. Can you tell me if this is possible to make this change with this page code, and if so, how to do it, please?

thanks
Attached Files
File Type: txt register1.txt (39.8 KB, 4 views)
chrisj is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-02-2008, 03:08 AM Re: Making the User Name be the Email Address
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
This has to be something you got from another site. It's the usual ASP dog's breakfast that most people create.

Anyway, I can help you with part of this, but you're going to have to do some digging to find the other parts
Change this part:
Code:
               <td width="150">Username:</td>
               <td><input style="width: 100%;" type="Text" name="username" value="" size="40" maxlength="25" class="textbox" /></td>
To...
Code:
               <td width="150">Confirm Email:</td>
               <td><input style="width: 100%;" type="Text" name="Email_Confirm" value="" size="40" maxlength="75" class="textbox" /></td>
I bolded the parts I changed. The maxlength property has to be changed to accommodate a proper email address.

As far as how to validate it, you'd have to change the line I bolded below:
Code:
        With Request
            sNAME     = APO(.Form("name"))
            sEMAILCONFIRM = APO(.Form("Email_Confirm"))
Then you'd have to add some form of validation somewhere before the database insert queries. I suspect that it's something in the CHECK_INP() sub, but I don't know where it would be exactly since that sub isn't in your code (it's probably in one of the include files).

You'll also need to alter anywhere that the user logs in to incorporate checking for email instead of username.

But...all of this leads to a much deeper issue. The type of question that you're asking is one that involves multiple parts, and you hadn't even gotten as far as the first one. That usually implies that you've bitten off a lot more than you can chew. The fact that you're using a script that someone else supplied also implies that.

Whatever it is you're doing, you may want to scale back your expectations of yourself and the script and go easy on yourself.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 01-02-2008, 03:20 PM Re: Making the User Name be the Email Address
Extreme Talker

Posts: 216
Trades: 0
Thank you
chrisj is offline
Reply With Quote
View Public Profile
 
Old 01-03-2008, 03:25 PM Re: Making the User Name be the Email Address
Extreme Talker

Posts: 216
Trades: 0
Thanks. I have some questions.

Is the validation for making sure that the fields match each other?
Or is validation for something else?

Thanks
chrisj is offline
Reply With Quote
View Public Profile
 
Old 01-03-2008, 05:06 PM Re: Making the User Name be the Email Address
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Making sure the fields match each other.

if (your email field) = (your email confirmation) field.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 01-03-2008, 07:14 PM Re: Making the User Name be the Email Address
Extreme Talker

Posts: 216
Trades: 0
Thanks for your reply/help.

There's a file in the script called validate.asp. Could you look it over and tell me if this is where this validation would take place and need to be modified?

Thanks again.

Code:
<!--#include file="app_config.asp"-->
 <!--#include file="inc_api.asp"-->
    <!--#include file="inc_header.asp"-->
        <%Dim sSQL, sRS, sID, sNAME, sCHAR, sFOUND, URL_ERROR, USERNAME, PASSWORD, EMAIL, STATUS
  
        sCHAR = APO(Request.QueryString("char"))
        sID   = APO(Request.QueryString("ID"))
        
        IF IS_VALID_ID(sID) = True AND NOT (sID = "" OR IsNUll(sID)) THEN
            SQL = "SELECT fldNAME, fldUSERNAME, fldPASSWORD, fldEMAIL, fldSTATUS FROM mms_tbl_user WHERE ID = " & sID & " AND fldCHAR ='" & sCHAR & "'"
            Call OPEN_DB()        
            Set RS = Server.CreateObject("ADODB.Recordset")
            RS.LockType   = 1
            RS.CursorType = 0
            RS.Open SQL, MyConn 
              IF NOT RS.EOF THEN
               sNAME  = trim(RS("fldNAME"))
     USERNAME  = trim(RS("fldUSERNAME"))
     PASSWORD  = trim(RS("fldPASSWORD"))
     EMAIL  = trim(RS("fldEMAIL"))   
     STATUS  = trim(RS("fldSTATUS"))
                    sFOUND = True
                 ELSE
                    sFOUND = False
              END IF
            RS.Close 
            Set RS = Nothing      
    
            IF sFOUND = True THEN
  
    
    SELECT CASE Trim(STATUS)
    
     CASE Trim(drpSTATUS(5)) ' Unpaid Account
    
      SQL = "UPDATE mms_tbl_user SET fldVALID = 1 WHERE ID = " & sID
               MyConn.Execute(SQL)    
              
         Call RETURN_VALUE(False)
                  Call APPEND_LOG(False, sID, "Your profile has been validated.", Trim(sysVAL(7)))    
    
     CASE Trim(drpSTATUS(1)), Trim(drpSTATUS(0)) ' Pending, Registered
     
      SQL = "UPDATE mms_tbl_user SET fldVALID = 1, fldSTATUS = '" & Cstr(drpSTATUS(0)) & "' WHERE ID = " & sID
               MyConn.Execute(SQL)    
              
         Call RETURN_VALUE(False)
                  Call APPEND_LOG(False, sID, "Your profile has been validated.", Trim(sysVAL(7)))      
     
    END SELECT    
    
            END IF
   
         Call RETURN_VALUE(False)
   
            Dim SaccountVALID
            SaccountVALID = RETURN_TEMPLATES(False,"fldMSG12", False)                
      
            MyConn.Close
            Set MyConn = Nothing
   
            SaccountVALID = Replace(SaccountVALID,"%name%", sNAME)
   SaccountVALID = Replace(SaccountVALID,"%username%", USERNAME)
   SaccountVALID = Replace(SaccountVALID,"%password%", PASSWORD)
   SaccountVALID = Replace(SaccountVALID,"%now%", Now())
            Call SEND_EMAIL_OUT(SaccountVALID , "Your account has been activated", EMAIL, Trim(sysVAL(12)), "")
   
        ELSE
            sFOUND = False
            URL_ERROR = "Invalid validation string, please make sure to use the entire URL."               
        END IF    
        %>    
        <table width="80%" align="center" cellpadding="2" cellspacing="0" border="1" bordercolor="WhiteSmoke">
        <tr bgcolor="whiteSmoke">
         <td>Validation</td>
        </tr><tr>
         <td>
            <% IF sFOUND = True THEN %>
                Thank you <%= sNAME %>,<br /><br />
                Your profile has been successfully validated.<br />
            <% ELSE %>    
                Sorry, we were unable to find a matching profile.<br />            
            <% END IF %>
            <% IF NOT (URL_ERROR = "" OR IsNull(URL_ERROR)) THEN %>
                <%=URL_ERROR%>
            <% End If %>
            <br /><br />        
            </td>
        </tr></table>
               
    <!--#include file="inc_footer.asp"-->
chrisj is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Making the User Name be the Email Address
 

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.33361 seconds with 13 queries