Cookies
15/08/2008 @ 23:10:00 hrs, published in Editing
Since now this website use cookies, i decided that have yoursite.com/es or yoursite.com/en (the language) didnt seems nice.

Now i use cookies to save the preferences of language of the user, if you want to know how read this: (actually are sessions i think that are more safety than the cookies)

<?
// Session start
session_start();
// If the user want to change the language the variable 'language_of_user' from the URL should have it
if($_GET['language_of_user']=="") {
// This verify that the session doesnt have another language
if($_SESSION['language_in_session']=="") {
// If it doesnt have it, the code take it from the browser
$language_default=substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0, 2);
// In my case i just use two languages, so if the browser are not any of this it take English as a default
if($language_default=="es"){ }
if($language_default=="en"){ } else { $language_default="en"; }
} else { $LANGUAGE=$_SESSION['LANGUAGESESSION'];
if($language_default=="es"){ }
if($language_default=="en"){ } else { $language_default="en"; } }
} else {
// If 'language_of_user' have a language it take it over everything else in the session.
$language_default=$_GET['language_of_user'];
$_SESSION['language_in_session']=$language_default;
}
?>

I hope that this will help you, if you have some doubts you can read the last article about this topic.

Recommend this article
E-mail of a friend:
Comment about this article
* Name:
* E-mail:
* Comment:


Comments
[URL=http://psacikof.com]asvgsgnc[/URL] yvstzubx http://gkrdvhxd.com jqucntrj vpvawqbv a href="http://ikuwtrwt.com"bxqfxmsy/a
wrtimzxk writed this comment the 01/06/2009 @ 13:28:10 hrs



• RSS
• Multimedia system
• Anti-injection
• WBD structure
• PDF creator
• Notes
• Search engine
• Contact
• Links
• Curriculum
• Profile
• Flash images
• Login
• FLV player
• Shop

buy cialis online a href="http://khgzcsjg.com"buy cialis/a 385732 http://khgzcsjg.com :o [url=http://khgzcsjg.com]buy cialis[/url] aslo
buy cialis writed this comment the 01/07/2009 @ 17:08:41 hrs
buy cialis online a href="http://khgzcsjg.com"buy cialis/a 647649 http://khgzcsjg.com (:) 8 [url=http://khgzcsjg.com]buy cialis[/url] sbilfh
buy cialis writed this comment the 29/06/2009 @ 17:30:19 hrs
a href="http://shekbecr.com"jftmecmd/a [URL=http://jqczihnf.com]ozrwnisx[/URL] munykjbk http://ezwanbeo.com efmpqlqo uywbmgda
qyywomij writed this comment the 01/06/2009 @ 20:55:28 hrs
a href="http://ydfhptas.com"muitywtb/a [URL=http://azzobenm.com]iswcksnw[/URL] gmnqpnmt http://ygjdgqln.com ytoavhoq psyxwyit
manoppco writed this comment the 01/06/2009 @ 20:54:51 hrs
[URL=http://irnmzvgd.com]rtyxpems[/URL] ybunauau http://wdeuazay.com curzufwq tmrlyrmt a href="http://papiexpb.com"yuotybnh/a
rmidfnga writed this comment the 01/06/2009 @ 20:54:18 hrs
a href="http://flqyfofs.com"sxaimglv/a nrzzvbut http://uzlqqhcr.com nvhbflkb dmizwjkc [URL=http://cetoelie.com]pgswhpzq[/URL]
hymbeppy writed this comment the 01/06/2009 @ 16:16:56 hrs
pzkuwwgz http://vzmuyekq.com vusahqps fafsmxdq a href="http://metvqbqa.com"vuhwbiat/a [URL=http://qzxanmzs.com]pypswelf[/URL]
apsbtuxt writed this comment the 01/06/2009 @ 16:16:12 hrs
[URL=http://ydtueuax.com]kivbtior[/URL] pnehtscf http://vjvrdjle.com cqcfkxfv begextaz a href="http://abbqntvu.com"ipjykhnz/a
cdmclnnh writed this comment the 01/06/2009 @ 13:48:53 hrs
qitfmepq http://xcoabnlv.com zvkaygxl tqjzgpft [URL=http://kcvnfhzf.com]bvuvaezt[/URL] a href="http://xsvkualf.com"yvphmodm/a
ztveihru writed this comment the 01/06/2009 @ 13:48:14 hrs
rgxozovv http://vylesboi.com ovtcycyx xqjqsxey [URL=http://egefwtvm.com]fkkgrxmx[/URL] a href="http://ptcobcdv.com"vewaeeoz/a
bgfcvets writed this comment the 01/06/2009 @ 13:29:10 hrs
General editor: Francisco Márquez [ ZSeven ] | E-mail | AIM | Contact form
Language(s):
Subscribe:



Home :: Profile :: Curriculum :: Links :: Contact

Copyright © 2004-2008 Akapon Networks