myrickcomputers Posted January 24, 2009 Share Posted January 24, 2009 i am trying to create a logout link to log users out of an employee area only on my website any ideas? Quote Link to comment Share on other sites More sharing options...
nuttycoder Posted January 24, 2009 Share Posted January 24, 2009 how are there login details stored cookies, sessions? Quote Link to comment Share on other sites More sharing options...
myrickcomputers Posted January 24, 2009 Author Share Posted January 24, 2009 cookies Quote Link to comment Share on other sites More sharing options...
nuttycoder Posted January 24, 2009 Share Posted January 24, 2009 to unset the cookie set it to a previous time mycookie refers to the name of your cookie  setcookie("mycookie","",time()-3600);  create a link to a php file with this code in it like  <a href="logout.php">logout</a>  Login.php  <?php setcookie("mycookie","",time()-3600); //load index page header('Location: index.php'); ?> Quote Link to comment Share on other sites More sharing options...
myrickcomputers Posted January 24, 2009 Author Share Posted January 24, 2009 like i said i am very new to this and i am not sure whether it is a cookie or not b/c i just created a directory with .htaccess Quote Link to comment Share on other sites More sharing options...
nuttycoder Posted January 24, 2009 Share Posted January 24, 2009 is it htaccess bring a login box up? Quote Link to comment Share on other sites More sharing options...
myrickcomputers Posted January 24, 2009 Author Share Posted January 24, 2009 yes  the link to it is http://www.myrickcomputers.com/downloads Quote Link to comment Share on other sites More sharing options...
nuttycoder Posted January 24, 2009 Share Posted January 24, 2009 I don't use password with htaccess so I can't tell you but doing a quick look on google I found a post that may help http://www.webmasterworld.com/forum13/3147.htm Quote Link to comment Share on other sites More sharing options...
myrickcomputers Posted January 24, 2009 Author Share Posted January 24, 2009 that did not work for my site any other ideas Quote Link to comment Share on other sites More sharing options...
jeger003 Posted January 24, 2009 Share Posted January 24, 2009 how about posting your login code here and maybe some one can make something of it Quote Link to comment Share on other sites More sharing options...
myrickcomputers Posted January 24, 2009 Author Share Posted January 24, 2009 if you could tell me where to find it on my site i would but i didnt set up the .htaccess my webhost did Quote Link to comment Share on other sites More sharing options...
nuttycoder Posted January 24, 2009 Share Posted January 24, 2009 normally it would be located in the root of your site or in the folder your protecting Quote Link to comment Share on other sites More sharing options...
myrickcomputers Posted January 24, 2009 Author Share Posted January 24, 2009 i cant find the .htaccess file  Quote Link to comment Share on other sites More sharing options...
.josh Posted January 24, 2009 Share Posted January 24, 2009 using a .htaccess for 'logging in' only password protects a directory and its subdirectories. There is no 'logging out' from it, except to just, you know, leave the directory.  It is not the same as a full fledged login system. Quote Link to comment Share on other sites More sharing options...
nuttycoder Posted January 24, 2009 Share Posted January 24, 2009 If you want to create a login/logout system here's a good tutorial for it http://www.newmedia.lincoln.ac.uk/dcarr/tutorials/php/login-script-with-validation Quote Link to comment Share on other sites More sharing options...
myrickcomputers Posted January 24, 2009 Author Share Posted January 24, 2009 i am afraid to say that is still over my head Quote Link to comment Share on other sites More sharing options...
nuttycoder Posted January 24, 2009 Share Posted January 24, 2009 in that case your best off getting a good php book that starts at from scratch and take it from there. Quote Link to comment Share on other sites More sharing options...
myrickcomputers Posted January 24, 2009 Author Share Posted January 24, 2009 thanks for the help 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.