forumsudhir Posted July 18, 2008 Share Posted July 18, 2008 i want to create page where is link if user click the link and user is not singin so show the page to enter user name and password............. Quote Link to comment Share on other sites More sharing options...
Stephen Posted July 18, 2008 Share Posted July 18, 2008 Assuming you're using cookies for logging in (and the cookie names are "username" and "password", you could do something like: if (!isset($_COOKIE["username"]) || !isset($_COOKIE["password"])) { include("mylogin.php"); } else { //your member page info } That's very simple though. You should also check if the username is correct, if the password is correct for that username, and so on. Quote Link to comment Share on other sites More sharing options...
waynewex Posted July 18, 2008 Share Posted July 18, 2008 Should you really store passwords in cookies? Quote Link to comment Share on other sites More sharing options...
awpti Posted July 18, 2008 Share Posted July 18, 2008 You shouldn't store usernames or passwords in a cookie. It's just bad juju. Quote Link to comment Share on other sites More sharing options...
Stephen Posted July 18, 2008 Share Posted July 18, 2008 Change $_COOKIE to $_SESSION and add session_start, and bam. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.