SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict amy.damnit's Avatar
    Join Date
    Sep 2009
    Posts
    336
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Finishing Checking Out after a Validation Email

    I am building my first ever Registration System using PHP.

    The process goes something like this...

    - User enters Email address
    - System ensures Email is unique
    - System passes user to Registration Form
    - User submits Registration Form
    - System temporarily stores info in a Session.
    - System writes Registration Info to database
    - System sends "Activation Email" to user
    - User clicks on link in email to activate account
    - User is taken to Log-In page
    - User logs in to System

    Question:

    After the User Logs In, how can I pick up where the Check-Out process left off??

    Because I am new to PHP, and under an extreme deadline (e.g. this week), and I haven't had time to build a "Shopping Cart", how can I keep track of the Seminar the User chose earlier?

    Originally I was going to store the Seminar Info in a Session, however, if the user shuts off their computer while waiting for their Activation Email and then comes back to finish up checking out, then I would lose the session information.

    (**NOTE: I don't need a formal "Shopping Cart" at this point because any given user can only register for ONE seminar at a time and the price is the same. The only difference is location.)

    That being said, I originally was going to use a session until I realized that my requirement that a new user "Activates" their account via clicking on a link in an email before they finish checking out would break up the continuity of things?!

    An alternative would be to write the Seminar info to my MySQL database, but I'm really in over my head - and way behind schedule on my deadline!!

    Can someone help me figure this all out?!

    Thanks,


    Amy

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,399
    Mentioned
    147 Post(s)
    Tagged
    4 Thread(s)
    You'll have to save the chosen seminar in your database, you might give it a specific status (like pending). Once the user activates its account and logs in, you can check your database to see if the user has any seminars 'pending', and continue the process from there.

  3. #3
    SitePoint Addict amy.damnit's Avatar
    Join Date
    Sep 2009
    Posts
    336
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the response, Guido!

    Say, after I made my post last night - and was tossing and turning in bed - I started thinking I need to clarify my real concern...

    Seminar Registration Process:
    - User browses seminars
    - User selects particular Seminar Date/Location
    - User reviews Seminar Details
    - User chooses "Add To Cart" (even though that is a misnomer)
    - User enters Email address
    - System ensures Email is unique
    - User completes Registration Form
    - User submits Registration Form
    - System writes Registration Info to database
    (- User could leave and return later?!!)
    - System sends "Activation Email" to User
    - User opens Email
    - User clicks on link "Activate Account"
    - System "activates" User's account
    - System displays message "Your account has been activated!"
    - User is taken to Log-In page
    (- User could leave and return later?!!)
    - User logs in to System

    Desired behavior from here...

    - User is taken to screen "Approve Registration" which details the Seminar, Date, Time, Location, and Price of Selected Seminar.

    (This would look like a basic final "check out" page on an e-commerce site, although it is a "pseudo shopping cart" because a User would not have selected multiple seminars with different prices and what-not. The Seminar Date/Time does need to match whatever the User selected above, though.)

    - User reviews and confirms Registration Details.
    - User choose "Register"
    - System User registered for particular Seminar Date/Time in database.
    - System displays "Confirmation Page"

    <<Use-Case ends relative to this post>>

    So how do I get the User from an "Activation E-mail" to a Log-In Screen and then to the appropriate "Approve Registration" screen??

    What I don't want the User to have to do, is to Log-In and then have to figure out where to find "Approve Registration" is located?!

    The system needs to be intelligent enough to say, "User #123 just logged in, take them to their specific "Approve Registration" screen/details.

    Hope that process flow makes sense?!

    I agree with what you said about - for now - just saving the Seminar they choose in a back-end table.

    But how do I get my Log-In screen to know to look at THAT RECORD in the database so it knows where to re-direct said user?!

    Thanks,


    Amy

  4. #4
    SitePoint Zealot Kayarc's Avatar
    Join Date
    Sep 2009
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by amy.damnit View Post
    So how do I get the User from an "Activation E-mail" to a Log-In Screen and then to the appropriate "Approve Registration" screen??
    A link in the email with a $_GET string of numbers unique to that user. Alternatively, you can set something in the db like 'user_state' = 'approve'. the bad thing about that is you'd have to check every login for user_state

    Quote Originally Posted by amy.damnit View Post
    What I don't want the User to have to do, is to Log-In and then have to figure out where to find "Approve Registration" is located?!
    That'd be terrible usability.

    Hope my volunteer support was good enough for you this time.
    Phoenix Arizona Web Design | info *at* kayarc.com | 602.633.2676

  5. #5
    SitePoint Addict amy.damnit's Avatar
    Join Date
    Sep 2009
    Posts
    336
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is an idea I had last night... (Why do I dream about PHP?! )

    The code I'm using from my book appends the User's E-mail and an Activation Code (that has been hashed) to the e-mail link the user clicks on to activate his/her account.

    What if I also appended on some code represent the Seminar (e.g. SeminarID)??

    Then the flow would go like this...

    - System sends email with link including: User Email, Activation Code, & SeminarID.
    - User gets email
    - User opens email and clicks on link
    - User is taken to Log-In page
    - System reads link (Is that possible??), and places the User Email and SeminarID in session variables.
    - User logs in
    - System verifies User successfully logged in
    - System reads session array
    - Based on values read from Sesion Variables, System routes User to appropriate "Approve Registration" screen


    How does that sound for an approach??

    I could write the User Email and SeminarID into my Users table, but the main thing I want is for the User to Log In and immediately be taken to "Check Out" to approve the Seminar Date/Venue they selected.

    (Yes, in an ideal world I would have a normal shopping cart and checkout process with a persistent state, but unfortunately that will have to wait until I start getting $$ coming in as I am out of time!!)

    I'm open to anyone's ideas if they are thought out!

    Thanks,


    Amy

  6. #6
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Amy.

    I think you say,

    user picks seminars before their signup, and after his/her signup you want to relate that picked items with signed up user?

    Ok here it comes:
    - You can relate with IP, google how you can get IP, if user doesn't change IP during process that might help.
    or
    - You can send a key with the activatation mail which relates the picked items, so in signup your project relates them.

    Ask if you need help.

    Tolga Firatoglu


Bookmarks

Posting Permissions

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