mariovaldez.net
http://www.mariovaldez.net/webapps/forums/

log-out?
http://www.mariovaldez.net/webapps/forums/viewtopic.php?f=11&t=97
Page 1 of 1

Author:  joy [ 21 Aug 2004, 14:15 ]
Post subject:  log-out?

Hello! I just installed this script on my website and I love it! Thank you! I had tried three others and couldn't get them to work - I didn't have any problems with this, and I have zero php knowledge.

Anyways, I have a quick question for you - How long will someone stay logged in? Is there a way to change the log in time frame or a way for them to log out?

Oh, I'm also wondering if there's a way to make the "incorrect password" message display inside a table rather than at the top of the page?

Thanks a bunch!
Joy

Author:  mvaldez [ 21 Aug 2004, 17:13 ]
Post subject:  Logging out.

Joy:

> Hello! I just installed this script on my
> website and I love it! Thank you! I had
> tried three others and couldn't get them
> to work - I didn't have any problems with
> this, and I have zero php knowledge.

Nice to hear that!


> Anyways, I have a quick question for you
> - How long will someone stay logged in?
> Is there a way to change the log in time
> frame or a way for them to log out?

Ah. I think I didn't documented that. :oops:

You can create a link anywhere like this:
Code:
To logout click here: <a href="<?php echo $slogin_php_self."?logout=1" ?>">logout</a>.


You can put it in the header or footer section, so it will be available on every page. That code will create a link which URL is the current page with a "?logout=1" appended. So, if you don't want to write PHP code, you can also use something like:
Code:
To logout click here: <a href="index.php?logout=1">logout</a>.



> Oh, I'm also wondering if there's a way to
> make the "incorrect password" message
> display inside a table rather than at the
> top of the page?

Well, as the verification is done in the included slogin_lib.inc.php file, it will appear always at top of the page. If you want it to appear below the login box, you can open the slogin_lib.inc.php file, around line 138 there is this:
Code:
include_once ("header.inc.php");
echo "<div align=\"center\">{$slogin_text[$slogin_lang]["WrongLogin"]}</div>";
include_once ("slogin.inc.php");
include_once ("footer.inc.php");

Change it to this:
Code:
include_once ("header.inc.php");
include_once ("slogin.inc.php");
echo "<div align=\"center\">{$slogin_text[$slogin_lang]["WrongLogin"]}</div>";
include_once ("footer.inc.php");

Which is the mostly the same, we just switched the position of the slogin.inc.php file inclusion and now the message would appear after the login box.

If you want to change the code to suit your look and feel, you can edit the line:
Code:
echo "<div align=\"center\">{$slogin_text[$slogin_lang]["WrongLogin"]}</div>";

To use something like
Code:
echo "<table align=\"center\"><tr><td>{$slogin_text[$slogin_lang]["WrongLogin"]}</td></tr></table>";

Just be carefull with the quotes in the HTML code, you should use \" (backslash+quote).
Or better yet, if you are using Cascade Style Sheets (CSS) you can then modify the look and feel on the CSS file and just modify the PHP code to use a CSS class:
Code:
echo "<div class=\"warningbox\">{$slogin_text[$slogin_lang]["WrongLogin"]}</div>";



Hope this helps you, Joy.

Mario A. Valdez-Ramirez.

Author:  joy [ 23 Aug 2004, 14:26 ]
Post subject:  thanks!

thank you very much! that worked!

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/