Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Location
    houston, tx
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I use cookie to ID referring webpage to call custom welcome & CSS on main page

    Our business market is all our area high school seniors. I have registered "highschoolname+seniors.com" for each area "highschoolname". These will all redirect to our main domain. I want a sure way to identify which or our domains is the referring domain, and use this to call up a custom welcome message when our main index page loads, and possibly to set a custom color scheme for each high school (perhaps that schools colors) using CSS. Is this possible and what's the most elegant way to accomplish this concept? I am aware, of but not proficient in the use of cookies. I will appreciate any helpful guidance.

  • #2
    New Coder TripperTreats's Avatar
    Join Date
    Oct 2006
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No cookies are necessary.

    Code:
    document.referrer
    is the string of your previous website. Thus, you could have

    Code:
    switch (document.referrer) {
      case "http://www.georgewashingtonhighschoolseniors.com":
        javascript to tailor to this school; break;
      case "http://www.mlkhighschoolseniors.com":
    etc, etc.
    Psychedelic digital art at www.trippertreats.com.

    "And in the end, the love you take
    is equal to the love you make
    ."

  • #3
    New to the CF scene
    Join Date
    Jan 2007
    Location
    houston, tx
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Jason,

    This appears much more simple than I had expected. Probably obvious, I don't know a lot about coding, but I'm learning. Thanks again for the solution, I will let you know how I go with it.

    Steve Barnes


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •