Sign Up Page that Expires

Discussion in 'Templates customization' started by fitnessclubprofits, Jul 15, 2010.

  1. fitnessclubprofits

    fitnessclubprofits New Member

    Joined:
    Apr 16, 2010
    Messages:
    4
    Hi,

    I was wondering if it is possible to have a sign up page that expires. I want to use the usual sign up page that comes with amember but I want to be able to create sign up pages that expire after a certain period of time.

    I am familiar with PHP so if someone can point me in the right direction, that would be great.

    Thanks,

    G
  2. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    Expires in what way? Text on page that says 'This page (or offer) has expired' also how long after when does it need to expire?
  3. fitnessclubprofits

    fitnessclubprofits New Member

    Joined:
    Apr 16, 2010
    Messages:
    4
    I need it to expire after 48 hours and say "Sorry your offer has expired. Please re-submit your request for sign up"

    I could do the sign up page based on their email like signup.php?e=john@hotmail.com or something. Just need some direction here.

    Thanks.
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Sure this is possible. I guess your users will not be able to signup different way?
    You need to generate key when send signup offer and store that key in database(create additional table for this), along with time when it will be created.
    Then send link to signup page with key included for example:
    signup.php?signup_key=YOURGENERATEDKEY
    In signup page at the top of the page add this :
    PHP:
    <?php
    session_start
    ();
    if(!
    $_GET[signup_key]&&!$_SESSION[_signup_key_verified]){
    fatal_error("Signup without offer is not allowed");
    }
    if(!
    $_SESSION[_signup_key_verified]){
    // Verify key here (check expiration as well, and remove key from database when verified)
    if(verify_key($_GET[signup_key])){
      
    // If everything is ok in order to allow signup proccess: 
      
    $_SESSION[_signup_key_verified]++;

    }else{
    fatal_error("Incorrect or expired key");
    }

    }
    ?>

Share This Page