How can i lock up mysite?

Discussion in 'PHP' started by fordsho, Dec 24, 2006.

  1. #1
    I posted in the content area looking for a programmer/freelancer, but now i want to see if i could do it myself!

    Okay here is the task at hand. i own the same site as www.fishyspace.com what i want to do is i want to make all media Non viewable to non registered users. so basically lets say they click to view a video they will be prompted to register and not allowed to view it! it should be rather simple since the cms allready has a register part. i just need to know how or who to contact to do this! any insight at all is aperciated!
     
    fordsho, Dec 24, 2006 IP
  2. tandac

    tandac Active Member

    Messages:
    337
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Assuming you have some sort of media.php script it's pretty simple.

    Somewhere close to the top of said script put in something like:

    <?php
    if !($_SESSION['registered']) {
      exit;
    }
    ?>
    PHP:
    What you do in the IF statement is up to you. This is how I do things.
     
    tandac, Dec 24, 2006 IP
  3. Senpai IT

    Senpai IT Active Member

    Messages:
    453
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    68
    #3
    You can use HTTP authorization. I think that is the best and simpliest solution for you.
     
    Senpai IT, Dec 24, 2006 IP
  4. knine143

    knine143 Peon

    Messages:
    186
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    There must be some Session variable or Cookie that shows that a user is logged in.

    What you need to do is check if that variable exists, and if it does show them the video. If it doesn't, display a "log in or sign up" page.
     
    knine143, Dec 25, 2006 IP