Help making Cookies!Like Netlog.com

Discussion in 'HTML & Website Design' started by xnarutogodx, Oct 20, 2009.

  1. #1
    Okay First of all hi everyone from digitalpoint.Next of all I want to know If any of you guys know how to have cookies like Netlog. I'm going to have basically same way. English, Spanish, etc... And when you click on something it takes you the url ex:en.netlog.com. Then If you want to change language you go at the top and click on the languages it resets the cookies and takes you the front page. I'm a newbie at cookies and wondering if any of you guys can help.
     
    xnarutogodx, Oct 20, 2009 IP
  2. Pyrokinetic

    Pyrokinetic Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    search on google how to create cookies with javascript, then make it so when you select a language, it sets a cookie (and also have it linked to go to that language page). Name the cookie 'language', and the content you put into it from the buttons should be the same as the respective subdomain ie. clicking the 'English' button would set the cookie 'language' with the content 'en'

    then, the best way i can think to do it, would be with php, make your links like this:

    <a href="<?=$_COOKIE['language']?>.website.com/page.html">LINK</a>
    PHP:
    this way, say you chose the english language, it'd make all the links come out as en.website.com


    There's probably some javascript solutions to this, but I don't know them.
     
    Pyrokinetic, Oct 22, 2009 IP