GHow to make a protected PHP page ?

Discussion in 'PHP' started by chrisj, Apr 2, 2009.

  1. #1
    I'm using a PHP script and am adding a Paypal link, so when the user/purchaser returns to the PHP script he is routed to a protected page that only users who have made the payment can access.

    Can someone help me with the protected page part?
    Some clues, any help would be appreciated.
     
    chrisj, Apr 2, 2009 IP
  2. fex

    fex Peon

    Messages:
    89
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think the most safe way for your customers is to use sessions. Google will sort you out. Correct me if I'm wrong guys :)
     
    fex, Apr 2, 2009 IP
  3. SHOwnsYou

    SHOwnsYou Peon

    Messages:
    209
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I don't know specifically with paypal, but if you were just making a protected page for members, you would use sessions and utilize code like this...

    <?php
    database connection info

    session_start();
    if (session_is_registered(session_key)) {
    echo 'PAGE CODE HERE'
    }
    else {
    echo 'You must be logged in to view this page.';
    }
    ?>

    Hope this helps, but as I said, I am not positive for use specifically with paypal.
     
    SHOwnsYou, Apr 2, 2009 IP