| Author |
Topic Search Topic Options
|
cardsfan
Newbie
Joined: 11 December 2003
Status: Offline
Points: 2
|
Post Options
Thanks(0)
Quote Reply
Topic: Login From Different Page Posted: 11 December 2003 at 1:44pm |
I've just migrated everything over to the the newest version and everything works fine. Now I want to allow my members to be able to login from my homepage (different directory than the forum), I'm sure I could just put a form with user id and password and pass that information to the login_user.asp file but I also want to be able to recognize if the user is already logged in so I can maybe put a welcome 'username' on the homepage. I would also like to pull up the last 5 posted messages and who they we're posted by on the homepage
I thought this wouldn't be to difficult, the problem I run into is that my home page and other pages are not in the same directory as my forum. Anyone know of an easy way to do this?
|
 |
thekiwi
Mod Builder Group
Joined: 23 November 2003
Location: New Zealand
Status: Offline
Points: 392
|
Post Options
Thanks(0)
Quote Reply
Posted: 11 December 2003 at 3:11pm |
cardsfan wrote:
I've just migrated everything over to the the newest version and everything works fine. Now I want to allow my members to be able to login from my homepage (different directory than the forum), I'm sure I could just put a form with user id and password and pass that information to the login_user.asp file but I also want to be able to recognize if the user is already logged in so I can maybe put a welcome 'username' on the homepage. I would also like to pull up the last 5 posted messages and who they we're posted by on the homepage
I thought this wouldn't be to difficult, the problem I run into is that my home page and other pages are not in the same directory as my forum. Anyone know of an easy way to do this?
|
1. In your own login page(s), once you have a successful login just set the cookie
Response.Cookies("WWF")("UID") = "myusername759R1B9394"
Note:
-
WWF is the strCookieName, so change to yours
-
UPdate the cookie if you want to set its expiry, eg Response.Cookies(strCookieName).Expires = DateAdd("yyyy", 1, Now())
-
OPtional extras are Response.Cookies(strCookieName)("NS") = "0" if you want to set their "Not be Shown" in the Active User List (0=off,1=on)
-
Set A session variable for Last Visit - Session("dtmLastVisit") = CDate(Request.Cookies(strCookieName)("LTVST")) and then update the cookie for next visit with Response.Cookies(strCookieName)("LTVST") = CDbl(Now())
Once you've done this, you will be automatically "logged in"
2. For the last 5 POsted messages, you just need to query the database as per the WWF string and place that in your ASP home page
|
|
|
 |
cardsfan
Newbie
Joined: 11 December 2003
Status: Offline
Points: 2
|
Post Options
Thanks(0)
Quote Reply
Posted: 12 December 2003 at 7:01am |
Thanks I'll give that a shot today, I'll let you know if it works.
Thanks again
|
 |
shadow man
Mod Builder Group
Joined: 11 December 2003
Location: United Kingdom
Status: Offline
Points: 13
|
Post Options
Thanks(0)
Quote Reply
Posted: 14 December 2003 at 2:22pm |
|
i like the idea, but could you explain it in more detail?
|
|
|
 |
thekiwi
Mod Builder Group
Joined: 23 November 2003
Location: New Zealand
Status: Offline
Points: 392
|
Post Options
Thanks(0)
Quote Reply
Posted: 14 December 2003 at 2:25pm |
shadow man wrote:
i like the idea, but could you explain it in more detail? |
Which part?
|
|
|
 |
wistex
Mod Builder Group
Joined: 30 August 2003
Location: United States
Status: Offline
Points: 877
|
Post Options
Thanks(0)
Quote Reply
Posted: 14 December 2003 at 11:48pm |
If you use my Tutorial on Quick and Dirty SIte Integration, it may help. My method would allow you to use almost any code that works in the forum directory on any other page of your website.
Note that this method is "quick and dirty." There are much more efficient ways of doing this. But if you are in a hurry and want something to build upon, then this is for you.
I have used it on my site, and it allows me to have a universal login on every page among other things.
|
|
|
 |
shadow man
Mod Builder Group
Joined: 11 December 2003
Location: United Kingdom
Status: Offline
Points: 13
|
Post Options
Thanks(0)
Quote Reply
Posted: 15 December 2003 at 9:49am |
|
i'll take a look
|
|
|
 |
shadow man
Mod Builder Group
Joined: 11 December 2003
Location: United Kingdom
Status: Offline
Points: 13
|
Post Options
Thanks(0)
Quote Reply
Posted: 15 December 2003 at 10:16am |
|
which cookie do you read to determine the lngLoggedInUserID?
|
|
|
 |