Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2006
    Thanked 0 Times in 0 Posts

    starting session from activation e-mail

    My experience with dynamic web applications is very new so, as always any assistance will be greatly appreciated

    I want to conduct an interview with a user by having them fill in details over several pages on mysite.com. They do not have to fill in the interview pages in any particular order.

    So that the details are entered into the correct record in the database I understand that a session must be set up when the user starts. I want this to start at the page a new user is directed to from an account activation e-mail.

    Once the user comes to this opening page he/she would have 10 different pages that they could go to (they don't have to do the interview in order any) and I want the information that they entered on the last visit to appear in the form field (if anything is there)

    This is the beginning of the page the e-mail directs the user to
    PHP Code:
    <?php require_once('../Connections/connConn.php'); ?>
    // Load the tNG classes

    //Start log out user
    $logout = new tNG_Logout();
    //End log out user
    $query_rsUsers "SELECT * FROM users";
    $rsUsers mysql_query($query_rsUsers$connBSD) or die(mysql_error());
    $row_rsUsers mysql_fetch_assoc($rsUsers);
    $totalRows_rsUsers mysql_num_rows($rsUsers);
    Essentially my question is how do I start a session from an activation e-mail?

    After reading various sources I considered that session_register() might be the answer but seeing that it is depricated indicates to me that there is either a better way or, it is just plain wrong.

    Any help is appreciated.

  • #2
    Regular Coder ralph l mayo's Avatar
    Join Date
    Nov 2005
    Thanked 31 Times in 29 Posts
    all you need now is session_start() then you add things to the session by setting fields of the $_SESSION superglobal. You can use session_encode() to get a string representation of the session suitable for storing in the database. When they come back from the activation email select it from the database again and use session_decode().

    How you connect each person to their session data is up to you. If they're required to log in you can use whatever you've got going on now for your userid, if not, you can use the session_id(), and format your email so that the link back contains your.php?si=session_id()


    Posting Permissions

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