Results 1 to 9 of 9

Thread: customize look of website depending on browser URL address

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2001
    Location
    oxford, UK
    Posts
    149

    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

  2. #2
    Fanatic Member
    Join Date
    Jul 2001
    Location
    London UK
    Posts
    671
    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!

  3. #3
    Lively Member blackeyed's Avatar
    Join Date
    Nov 2002
    Location
    Chandigarh
    Posts
    118
    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.
    ~~Avi~~

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Apr 2001
    Location
    oxford, UK
    Posts
    149
    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

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Apr 2001
    Location
    oxford, UK
    Posts
    149
    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!!

  6. #6
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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..

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Apr 2001
    Location
    oxford, UK
    Posts
    149
    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

  8. #8
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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..

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Apr 2001
    Location
    oxford, UK
    Posts
    149
    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
  •  



Click Here to Expand Forum to Full Width