|
-
Nov 21st, 2002, 05:33 AM
#1
Thread Starter
Addicted Member
customize look of website depending on browser URL address
I have a ASP based website. I am trying to customize the look and feel for different customers. I have set certain Session variables e.g.
Session("StyleSheet") = cust1.css
Session("Logo") = cust2.gif
1) Is this a good way of developing 'clientisation'? Can you suggest any better techniques (which dont require 2 seperate websites to be maintained in parallel)?
2) A partner company is using a frameset to allow their URL to be displayed to their customers in the browser address field, whilst our website is displayed in main frame.
The way I'm doing it at the moment, I need to identify which customer is using site. I tried using "HTTP_Referrer" but this dosen't work once user goes between pages within the site if the Session variables are destroyed for any reason e.g. session timeout.
Can you tell me how to identify which address is currently displayed in address bar? Or a better way of doing it?
Any help ideas would be greatly appreciated!
Thanks
Kester
-
Nov 21st, 2002, 06:51 AM
#2
Fanatic Member
I haven't got a solution for you but your current solution seems extremely vulnerable. The default security settings in browsers for cross-frame / cross-domain scripting do seem to get tighter all the time!
-
Nov 21st, 2002, 06:55 AM
#3
Lively Member
For your second question you can try this javascript sentence
javascript:alert(document.location.href); it will give you the addess in the addressbar.
I guess the use of session variables for clientization is a good.
-
Nov 21st, 2002, 07:38 AM
#4
Thread Starter
Addicted Member
Blackeyed: thanks for the tip.
Martin: Yep I agree with you, about browser cross-frame / cross-domain issues. In fact I have already had to advise users to enable cookies if they're accessing our site in a frame from the external URL.
How should you provide websites that function the same but look different for different customers?
Ta
kest
-
Nov 22nd, 2002, 04:49 AM
#5
Thread Starter
Addicted Member
unfortunately the tip you suggested doesn't actually return the URL displayed in the address bar. It actually returns URL of the currently displayed webpage.
As i said before the webpage being displayed is within a frame of URL displayed in the address bar.
Any more ideas would be really greatfully appreciated!!
-
Nov 22nd, 2002, 10:27 AM
#6
Frenzied Member
Don't use sessions. Use cookies.
You can keep the layouts in separate CSS files.
Each time the user accesses the page, read the cookie to determine which css file to link to. This also allows you to give the user customization capabilities. They can select how they want to see things and you save it in the cookie. i.e. this forum. Is your layout blue? Did you know it could also be yellow? Same principles.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Nov 22nd, 2002, 10:37 AM
#7
Thread Starter
Addicted Member
Thanks Monte.
Funnily enough I was just starting to investigate cookies myself, wandering if that was the better approach. I am glad to have someone confim it!
I think cookies will also be a decent solution to let me allow users to select and store their preferred timezone, zoom level etc, which I will need to do sooner or later.
Is there any performance problem with reading the cookie on every page within a site i.e. to set the colours/stylesheet/logos etc?
Thanks
Kester
-
Nov 22nd, 2002, 05:39 PM
#8
Frenzied Member
Depends.. keep them small. If you need to store hashed values, it starts to become a performance hit. You could also get the cookie values on the initial page and pass the values from page to page. Checking each time should not cause any major performance hit. A small one at best...
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Nov 25th, 2002, 06:08 AM
#9
Thread Starter
Addicted Member
What are hashed values? Encoded to prevent user from viewing them? Anyway dont worry, I will search on net to understand.
thnx Monte.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|