PHP Login

Discussion in 'PHP' started by affnice, Jun 25, 2007.

  1. #1
    Hello I'm Newbie in PHP :eek:

    Anybody can help me ?

    here

    if i click data2.php link from page data1.php, then how can i set must login first before we landing in data2.php. if login success then we can access data2.php


    Thanks a lot :)
     
    affnice, Jun 25, 2007 IP
  2. pfek

    pfek Member

    Messages:
    98
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #2
    Hi,

    you could use a login form and set up a SESSION variable, which would be validated upon access of data2.php. It's kinda easy to set up, you just have to set the action to the same page and check the GET/POST value of your form with a database, or textfile maybe..

    You could use .htaccess too, but you would have to do something like putting the data2.php file in another directory. There are plenty of ways to do this kind of login script. Give feedback if you produce something cool!
     
    pfek, Jun 25, 2007 IP
  3. dp-user-1

    dp-user-1 Well-Known Member

    Messages:
    794
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #3
    pfek, you could use .htaccess without moving it to another directory.
     
    dp-user-1, Jun 25, 2007 IP
  4. amorph

    amorph Peon

    Messages:
    200
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    amorph, Jun 28, 2007 IP
  5. pfek

    pfek Member

    Messages:
    98
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #5
    Didn't knew, thx NinjaNoodles!
     
    pfek, Jun 29, 2007 IP