securing web page

Discussion in 'PHP' started by ianlufc, Apr 15, 2008.

  1. #1
    hi Guys

    im working on a college project..have users logging in and looking through various pages

    can someone tell me how to stop unauthorised people simply typeing in the full path of one of the pages and viewing it without logging in.

    e.g. i log in at index.php
    that brings me to main.php

    but if i type server/myproj/main.php
    it brings it up, is there any way of stopping this


    i appreciate your help in advance
    cheers
     
    ianlufc, Apr 15, 2008 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    use session variables

    ie.

    on top of your main.php

    if($_SESSION['name'] == "") ? redirect to index.php

    sessions will do the trick
     
    bartolay13, Apr 15, 2008 IP
  3. ianlufc

    ianlufc Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    cheers mate
     
    ianlufc, Apr 15, 2008 IP
  4. JLEville

    JLEville Peon

    Messages:
    147
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You could use sessions or cookies...if you don't know how to fix this, let me know and I'd be happy to do it for like 10 dollars. PM if you're interested, thanks.
     
    JLEville, Apr 15, 2008 IP