Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Central Ohio
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Confirm Subscription

    Ok, the base of my code is Ocean12 ASP Mailing List Manager. The free version of the script has it's limitations, so I'm attempting add a feature here & there on my own.

    As it stands, when you sign up for the Newsletter, it adds your e-mail to the database and that's it. The next step is I send a mailing to the list and get bounced e-mails for the people that say their e-mail address has a coma in it or that don't give me the "@yahoo.com" portion of their address.

    Rather than get 5-10 bounced e-mails at once, I'd rather 'weed them out' as I go. And provide a security feature into the script. The database table looks like this at Download:

    ID | EMail | First Name | Last Name | Date Joined

    I've added a sixth column to the table, "Conf" which is a Yes/No field. Either it's "true" or it's "false". I should mentioned, I'm running off of Access. By default, when a user signs up, the Conf field is set to 'False'. For all intents and purposes, this means they haven't "Confirmed" their subscription yet.

    At this point, and e-mail is sent to the directing them to a particular URL which will 'confirm' their subscription. I've skipped the automated e-mail for now, because I'm working on the page it directs them to first.

    This is where my problem comes in. To keep the the confirmation process somewhat secure, I'm directing them to "confirm.asp?Email=jer@jers-web.com" for instance, without the () of course.

    However, it's returning Syntax error (missing operator) in query expression 'Email = jer@jers-web.com'. The code I'm using follows:

    Code:
    ********Included Page, Cannot Edit Start********
    <%
    dim dsn
    dim Conn
    dsn="DBQ=" & Server.Mappath("/fpdb/o12mail.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open dsn
    %>
    ********Included Page, Cannot Edit End**********
    
    <%
    Dim strSql, infoRS
    
    Email = Request.QueryString("Email")
    %>
    
    <%
    IF Len(Email) > 0 THEN
    	GetImage()
    	DisplayGood()
    ELSE
    	DisplayBad()
    END IF
    
    %>
    
    <% Sub GetImage()
    	strSql = "SELECT * FROM List WHERE Email = " & Email & ";"
    	set infoRS = Conn.Execute(strSql) 
    End Sub %>
    
    <% Sub DisplayGood() %>
    
    <html>
    
    <head>
    </head>
    
    <body>
    
    <%= infoRS("Email") %><br><%= infoRS("Name_First") %><br><%= infoRS("Conf") %>
    </body>
    
    </html>
    <!--#include file="dsn2.asp"-->
    
    <% End Sub %>
    
    <% Sub DisplayBad() %>
    <html>
    
    <head>
    </head>
    
    <body>
    This is a Bad Display
    </body>
    
    </html>
    <!--#include file="dsn2.asp"-->
    <% End Sub %>
    Can I have an e-mail address in the URL like that? It's picking out "line 21" on the error, which is this line "set infoRS = Conn.Execute(strSql)". Any ideas?

    Any help is much appreciated! :-)

    Thanks!

    Jer!
    Jers-Web, Inc.
    Ever seen 49,825 Alert Boxes on one page? I have!

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try this instead:

    strSql = "SELECT * FROM List WHERE Email = '" & Email & "' "
    Last edited by whammy; 06-29-2002 at 12:50 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    Central Ohio
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *speaking in a very monotone voice while glancing occassionally at the palm of my hand to read a small piece of paper...*

    Thank...You...Very...Much...Whammy.
    This...Solved...My...Problem...Precisely.
    You...Should...Be...Nominated...For...Some...Super... Duper...Wonderful...Moderator...Award...Or...Something.
    You...Are...The...Man.

    Seriously, m8, thanks a bunch! :-)

    That did the trick! :-)

    Jer!
    Jers-Web, Inc.
    Ever seen 49,825 Alert Boxes on one page? I have!

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dang, I have to give better prompts!
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •