Lets say I make a webpage where users have to log in to www.mypage.com, then if their password is correct the webpage redirects them to www.mypage.com/enter. But how can I prevent other users from directly going into www.mypage.com/enter. Here is method I came up with, but I don't know if it is correct: when they log in, the webpage can save their IP address on a database, and redirect them to www.mypage.com/enter, and www.mypage.com/enter checks their IP address, if it is in the database, it shows them the page, otherwise it does not. Is this a good idea?
Other ideas are to make a POST method (in php), www.mypage.com/enter will catch the POST variable from www.mypage.com, if it does not exist, then it doesn't let you in. But would this way work if I have about 10 different links under www.mypage.com? Would it work if the user needs to browse from one page to another? What is the user closes the webpage, and opens it again, he would have to log in again!!
Can someone tell me best way
2007-05-05
05:31:03
·
3 answers
·
asked by
Anonymous