Pas na een refresh worden cookies aangemaakt.
Staat ook op php.net/setcookie
Staat ook op php.net/setcookie
Aarclay schreef:Ah, fixed:Pas na een refresh worden cookies aangemaakt.
Staat ook op php.net/setcookie
Milan schreef:Wat is er mis mee dan? Heb alleen maar if`s trouwens.En je if/else klopt niet

Dylanh schreef:1Codeblok (voorbeeld.php):
Dylanh schreef:Nu werk het niet meer.
Dylanh schreef:1Codeblok (voorbeeld.php):
Milan schreef:1Eerdere citaten tonen
Dylanh schreef:Nu werk het niet meer.Eerdere citaten tonen
Dylanh schreef:Codeblok (voorbeeld.php):
[COLOR= #0000BB]<?php
$langs[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]nl[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]en[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/in_array"]in_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]lang[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$langs[/COLOR][COLOR= #007700])) {[/COLOR]
[COLOR= #FF8000]// nieuwe cookie instellen[/COLOR]
[COLOR= #007700]}[/COLOR]
?> 
Dylanh schreef:dus?1Eerdere citaten tonen
Milan schreef:Eerdere citaten tonen
Dylanh schreef:Nu werk het niet meer.Eerdere citaten tonen
Dylanh schreef:Codeblok (voorbeeld.php):
if($_COOKIE[lang] != nl OR $_COOKIE[lang] != en OR $_COOKIE[lang] != de) {
include "lang_".$_COOKIE[lang]."inc.php" switch($_COOKIE[lang]) {
case nl:
$lang = nl;
break;
case de:
$lang = de;
break;
case en:
$lang = en;
break;
default:
$lang = en;
break;
}
include "lang_".$lang."inc.php"; 