Link to home
Start Free TrialLog in
Avatar of computer1000
computer1000

asked on

renew or cancel membership

I am trying to design the cancel/renew membership.asp page. Have you worked with it before? Please share it with me. I am trying to think of a way for it. Is there a way to include an expiration date when their membership has ended? I have included in the database a field with a timestamp. If the customer places a one month order, how will the site cut them off unless they renew their membership? I am confused on this one.
Avatar of weesiong
weesiong

computer1000,

When the user each time login, store the lastlogin time to database.

And validataion if user last time login is no over 1 month

Regards,
Wee Siong
Yes my final year project in my Polytechnic days is on Country Club using ColdFusion. You can use a select statement with a where clause like this.

<%
Dim intMonth, strSQL
Dim objConn, objRs

' your connection settings here

intMonth = 1
strSQL = "select * from your_table " & _
         "where expiry_date > " & DateAdd("m", intMonth, Now())

set objRs = objConn.Execute(strSQL)

if objRs.Eof then
    ' means expire
else
    ' means not expire
end if
%>

hongjun
SQLStr = "Select pwd, registerdate, firstlogindate, id from [user] where userid ='"&request("userid")&"'"
Rs.Open SQLStr, conn, 1, 3

IF Not Rs.Eof Then
     IF Rs("pwd") = request("pwd") Then
          IF DateDiff("d", Now, Rs("registerdate")) > 14 Then
               Response.redirect("mainpg.asp?error=3")
          Else
               IF Rs("firstlogindate") <> "" Then
               Else
                    Rs("firstlogindate") = Now
                    Rs.Update
               End IF
               Session("userid") = Rs("id")
               Response.redirect("main.asp")
          End IF
     Else
          Response.redirect("mainpg.asp?error=1")
     End IF
Else
     Response.redirect("mainpg.asp?error=1")
End IF

Regards,
Wee Siong
Big mistake by me above. I forgot to select only records belonging to the specific member.

I am assuming you are member_id is stored in a Session variable named ID and the page using the below code requires the user to be logged in.

<%
Dim intMonth, strSQL
Dim objConn, objRs

' your connection settings here

intMonth = 1

strSQL = "select * from your_table " & _
        "where expiry_date > '" & DateAdd("m", intMonth, Now()) & "' and member_id = '" & Session("ID") & "'"

set objRs = objConn.Execute(strSQL)

if objRs.Eof then
   ' means expire
else
   ' means not expire
end if
%>

hongjun
computer1000,

In access:

strSQL = "select * from your_table where lastlogin_date > DateAdd("m", -1, Now()) and member_id = " & Session("ID")

Regards,
Wee Siong
Avatar of computer1000

ASKER

Yes, I am using session variables. I did design a login page that requires the user to be logged in. I did design a registration page that requires the user to fill the information out with the hidden stamptime field (that stores login time/date to the database). If the customer wants to renew a membership, it redirects to the renewmembership page. If the customer wants to cancel a membership, contact the customer service department via e-mail.

Suppose, the customer wants to renew a membership in the renewmembership page, it has two buttons:
"Click here to purchase 1 month at $10.00"
"Click here to purchase 3 months at $25.00"

If the customer clicks on the first button, it takes to the authorize.net page (transaction online for verifying credit card) that shows the order information, credit card information and customer billing information.

Have you worked with this kind of project before? I have not worked with it before. If you have worked with cancel/renew membership project before, is there another way to do it other than what I have told you?

My question is how to include an expiration date into the database (I need to add expiration date field). If their membership has ended, how do I delete that customer? I want to inform the customer a week before their membership expiration.. how do I do it?

I think this question is very hard. I will add another 50 points for this..
100 to 150
Help me!
Ok Jenn...we are here...not to worry.  This just takes a little bit of thinking.

You really have 2 components here.  And they should (IMHO) be treated separately.

The first (as I see it) is the part where you don't let the member in if their membership has expired.

The way I would approach that is:

On your login page, you would have the option to sign-up for 1 month or 3 months.  In the SQL statement that adds this customer to the database, you can use something like

If request.form(subscriptionlength) = 1 then
DateExpires = DateDiff(Now, +30)<---help me with the syntax here people
End If

If request.form(subscriptionlength = 3 then
DateExpires = DateDiff(Now, +90)<--syntax again
End If

Then when the person accesses your site, you just need to check the DateExpires value:

If DateExpires < Date(Now) then
response.redirect to your renewal page
End If

<<I'm just throwing out ideas here, anybody feel free to correct them>>

Now as for the sending a reminder email....can you use CDONTS?
The only way I can think of to do the reminders is a little clunky.

I'm sure somebody here has a better way.

What I would do is create an ASP page which will run through the database, check the DateExpires field and if it is within the next 7 days send out the email.

The reason it is clunky is that you would have to access it and run it once/week.  (Unless someone can automate it, I just don't know how to do that.)

In the same page, and the same time you could delete any customers who have expired.  I would be a little careful about this though.  I'd prefer that they just got redirected to a renewal page if the expiry date is past, not deleted altogether.  This way, they can renew later on and you still have all their info in the db.  But if you are worried about db space, then delete them if the expiry was, say, over a month ago.

Does this help?
If you need to do something that needs to be automated like checking whose membership is to be expired in a week time, you need a script that will run automatically.

You can schedule it or run it yourself everyday morning example. For ColdFusion, they have the CFSCHEDULE tag that will do the scheduling. For ASP, one of the method is to rely on the NT scheduler. Read this that describes "How to Send Newsletter Automatically"
http://www.siteexperts.com/tips/backend/ts12/page1.asp

hongjun
ASKER CERTIFIED SOLUTION
Avatar of hongjun
hongjun
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My mother tongue is not English. Please pardon my English.

>>On your login page, you would have the option to sign-up for 1 month or 3 months.  In the SQL statement that adds this customer to the database, you can use something like


What are you trying to say? Are you saying if the customer wants to become a member, then the customer has to fill out the form along with the the membership terms on the same page before deciding to want to renew the membership...  Like this.

First Name .................
Last Name ................
...
...
...
Membership Terms   [] 1 month       []  3 month.   (Do I have do this like this?)

Submit Form


Do I have to do this like that above? Is there anothe way of putting membership terms other than on the registration form?

After filling out the form, it takes to the transaction online of some kind.. like www.authorize.net. When the customer fills out the order information, credit card information and customer billing information over the authorize.net site, how do I know if they are confirmed or not. Will the authorize.net let me know that they are confirmed or not by email?? When they finish filling the transaction online form out, where does it take them to? For example, I would like for them to go to the memberprofile page after they fill out the form over the authorize.net..

I don't have any experience with kind of transaction online of some kind before. Please share ideas with me.. I am just an entry level ASP programmer. Can we talk about the expiry date/automatic email later once I understand about the transcation online of some kind and where to put the membership terms?? I promise you that I will add another 50 points to this.
Don't add anymore points yet. 8-)

As for authorize.net, you need to look over their literature to see if they send emails on authorization or if they have the ability to send a message to the server.  On my credit card processor, I send the credit info to their SSL and if it is approved an approval code gets sent back to my confirmation page.  That is how my pages know whether to allow the download.

Like this:
If request.form("auth") = 1 then
  'statement to allow to continue
Else
  'statement that says, sorry your cc is no good
End If

As for selecting the membership duration....how do you envision it?  It is much better (IMHO) to have it on the form that to have it on a separate page.
Thanks very much.. I am waiting for the replies from my owner about the authorize site so wait for me.

Please go to my newest question from https://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=asp&qid=20154031

I have been so busy lately and I am sorry that I have not gotten with you. Please wait for a few days as the client has not said anything about the membership page. I'm sorry about this.
Experts: I think I should delete this question because my owner told me his customer will delete accounts if they have not paid for their renewal in the 3 month period through the admin page. I am going to split points between Weesiong, Hongjun, and ClassyLinks for helping. Do you have problem with this? Please let me know.
Response.Write("No Problem")
No problem.
I am waiting for ClassyLinks's comments.
Sure thing.
Hello all, computer1000 has requested a three way point split, it will go as follows:

50=hongjun
50=weesiong
50=ClassyLinks

I will reduce the numbe of points to 50 to allow for the split.

computer1000, you will need to accept the question for one of the above Experts (50 points), and create two new questions in this Topic Area.

Entitle the Questions *Points for <Expert>* and in the comment box state *For your help in solving my question #20152580*

Then click on the 50 point button and click on Submit.  Do this for each of the two remaining Experts and the split will be complete.

Thanks,
ComTech
Community Support

Ps. If you require any further assistance, please post and I will get the notification.
Experts: I am going to accept Hongjun's answer because it seems like he's already leaving for an army from August 24th. For other experts, please leave your comments to my questions so that way I can accept them..