Thread: Error messages
View Single Post
  #3 (permalink)  
Old June 5th, 2005, 06:54 AM
ldoodle ldoodle is offline
Authorized User
Join Date: Jun 2005
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts

Basically, I've created a database with just 2 field names, no data. They're titled 'UserName' and 'UserStyle', with 'UserName' as the primary key. I've got an internal website running on a Windows 2003 AD domain, which requires users to logon using their username/password from AD.

I've got a page on this website that allows them to change the stylesheet (there's 6 styles).

What I want to happen, is the following (if possible);

In default.asp (which is the main page)
If the user logs on for the first time, it creates a record in the 'UserName' field whith their username from AD, and creates a record in the 'UserStyle' field with the default style, which is blue.css. Any further visits will see that the user already has a record in the DB, so will not create a duplicate record.

In userEnv.asp (which is included in all other pages)
It looks in the DB to see if the user has a record, which they should do as it's the first thing that happens when they logon, and sets the record in 'UserStyle' (which is still blue.css) as a variable called strUserStyle. Each page then uses this variable to set the stylesheet.

on the update_style.asp page
When they select a new style, it *updates* the users record in the DB with the new style (silver.css for example), then each page uses the new style as the stylesheet.

Hope this makes sense!!

Thanks for any help/...