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

01-12-2007, 02:41 AM
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.

01-12-2007, 05:07 AM
No cookies are necessary.

document.referreris the string of your previous website. Thus, you could have

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

01-12-2007, 02:18 PM
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