taalkeuze cookie
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
$homepage = 'http://'.$_SERVER["HTTP_HOST"].'/';
if ($_REQUEST['act'] == "setLang") {
//check to see if the form has been submitted!
if ($_REQUEST['lang'] == "") {
header('Location: '.$_SERVER["PHP_SELF"]);
//if language selection is empty, redirect to form!
}
else {
//if language was selected, save it in a cookie, then redirect to appropriate page!
$lang = $_REQUEST['lang'];
setcookie("language", $lang, time()+3600);
header('Location: '.$homepage.$lang.'/index'.$lang.'.php');
}
}
else {
//if form has not been submitted
if (@$_COOKIE['language'] != "") {
/* check to see if language cookie is empty. If not, redirect to appropriate page. */
header('Location: '.$homepage.$_COOKIE["language"].'/index'.$_COOKIE["language"].'.php');
}
else {
//if cookie is empty, display form
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<head>
<title>Ceci Casariego: portretten, portret, interieur decoratie, ontwerp en creaties</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="all" type="text/css" href="site.css">
<meta http-equiv="imagetoolbar" content="no">
<script src="links.js" type="text/javascript"></script>
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
</head>
<body>
<div id="header-main">
<div id="header">
<h1>Ceci CASARIEGO</h1>
<ul>
<li class="nav"><a href="?act=setLang&lang=NL">Nederlands</a></li>
<li class="nav"><a href="?act=setLang&lang=EN">English</a></li>
<li class="nav"><a href="?act=setLang&lang=FR">Français</a></li>
</ul>
</div>
</div>
<div id="body-main">
<div id="body">
<div id="left">
</div>
<div id="right">
</div>
</div>
</div>
</body>
</html>
<?php
}
}
[/code]
Dit is een php code die de taalkeuze zou moeten bewaren voor volgend bezoek. Probleem is dat de href niet juist gedefinieerd is.
- NL: moet naar indexNL.php (en niet ?act=setLang&lang=NL)
- FR: moet naar indexFR.php (en niet ?act=setLang&langFR)
- EN: moet naar indexGB.php (en niet ?act=setLang&lang=EN)
Hoe moeten de href dan geplaatst worden, aub ?
$homepage = 'http://'.$_SERVER["HTTP_HOST"].'/';
if ($_REQUEST['act'] == "setLang") {
//check to see if the form has been submitted!
if ($_REQUEST['lang'] == "") {
header('Location: '.$_SERVER["PHP_SELF"]);
//if language selection is empty, redirect to form!
}
else {
//if language was selected, save it in a cookie, then redirect to appropriate page!
$lang = $_REQUEST['lang'];
setcookie("language", $lang, time()+3600);
header('Location: '.$homepage.$lang.'/index'.$lang.'.php');
}
}
else {
//if form has not been submitted
if (@$_COOKIE['language'] != "") {
/* check to see if language cookie is empty. If not, redirect to appropriate page. */
header('Location: '.$homepage.$_COOKIE["language"].'/index'.$_COOKIE["language"].'.php');
}
else {
//if cookie is empty, display form
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<head>
<title>Ceci Casariego: portretten, portret, interieur decoratie, ontwerp en creaties</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="all" type="text/css" href="site.css">
<meta http-equiv="imagetoolbar" content="no">
<script src="links.js" type="text/javascript"></script>
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
</head>
<body>
<div id="header-main">
<div id="header">
<h1>Ceci CASARIEGO</h1>
<ul>
<li class="nav"><a href="?act=setLang&lang=NL">Nederlands</a></li>
<li class="nav"><a href="?act=setLang&lang=EN">English</a></li>
<li class="nav"><a href="?act=setLang&lang=FR">Français</a></li>
</ul>
</div>
</div>
<div id="body-main">
<div id="body">
<div id="left">
</div>
<div id="right">
</div>
</div>
</div>
</body>
</html>
<?php
}
}
[/code]
Dit is een php code die de taalkeuze zou moeten bewaren voor volgend bezoek. Probleem is dat de href niet juist gedefinieerd is.
- NL: moet naar indexNL.php (en niet ?act=setLang&lang=NL)
- FR: moet naar indexFR.php (en niet ?act=setLang&langFR)
- EN: moet naar indexGB.php (en niet ?act=setLang&lang=EN)
Hoe moeten de href dan geplaatst worden, aub ?
href="indexNL.php"
Indien het werkt, kan ik natuurlijk de andere twee links niet controleren, dus hoe kan ik die functie dan annuleren ?
In je script wordt er hier naar verwezen:
Dat wordt dus: http://mijnsite.nlNL/indexNL.php
Zie je de fout?
Zo heb ik het makkelijker voor later gebruik. Bedankt !
Gewijzigd op 01/01/1970 01:00:00 door chechu
Hint: Er staat een '$lang' teveel.
You can do it boy!
Maar dit kan toch niet, met twee keer nl na elkaar ?
Quote:
Hint: Er staat een '$lang' teveel.
Waar ?
Quote:
You can do it boy!
Girl ! En nee hoor, want ik ken niks van php...
You can do it girl, or just start learning PHP, kthxbai.
Maak vriend Voeg chechu toe aan 'friends' lijst
Intern privé bericht Stuur chechu een intern privé bericht
Geslacht Man
Code (php)
hoop dat het nu duidelijk is?
en dat jij je code nu kunt aanpassen zo dat het werkt ;)
Gewijzigd op 01/01/1970 01:00:00 door RvW Of toch niet
Dankjewel !!!
Code (php)
Gaat niet werken. Dan krijg je inderdaad mijnsite.nlNL, er moet dus nog een " / " tussen :)
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
$homepage = 'http://'.$_SERVER["HTTP_HOST"].'/';
if ($_REQUEST['act'] == "setLang") {
//check to see if the form has been submitted!
if ($_REQUEST['lang'] == "") {
header('Location: '.$_SERVER["PHP_SELF"]);
//if language selection is empty, redirect to form!
}
else {
//if language was selected, save it in a cookie, then redirect to appropriate page!
$lang = $_REQUEST['lang'];
setcookie("language", $lang, time()+3600);
header('Location: '.$homepage.'/index'.$lang.'.php');
}
}
else {
//if form has not been submitted
if (@$_COOKIE['language'] != "") {
/* check to see if language cookie is empty. If not, redirect to appropriate page. */
header('Location: '.$homepage.$_COOKIE["language"].'/index'.$_COOKIE["language"].'.php');
}
else {
//if cookie is empty, display form
?>
$homepage = 'http://'.$_SERVER["HTTP_HOST"].'/';
if ($_REQUEST['act'] == "setLang") {
//check to see if the form has been submitted!
if ($_REQUEST['lang'] == "") {
header('Location: '.$_SERVER["PHP_SELF"]);
//if language selection is empty, redirect to form!
}
else {
//if language was selected, save it in a cookie, then redirect to appropriate page!
$lang = $_REQUEST['lang'];
setcookie("language", $lang, time()+3600);
header('Location: '.$homepage.'/index'.$lang.'.php');
}
}
else {
//if form has not been submitted
if (@$_COOKIE['language'] != "") {
/* check to see if language cookie is empty. If not, redirect to appropriate page. */
header('Location: '.$homepage.$_COOKIE["language"].'/index'.$_COOKIE["language"].'.php');
}
else {
//if cookie is empty, display form
?>
Gewijzigd op 01/01/1970 01:00:00 door chechu
wat verwacht je dat hier de uit voer van zal zijn?
header('Location: '.$homepage.'/index'.$_COOKIE["language"].'.php');
en wat verwacht je hier van ?
de tweede correct is ?
2e mijnsite.nl/indexNL.php
en of dat correct is durf ik geen uitspraak over te doen ;)
maar dat is volgens mij wel wat je vroeg...
http://www.cecicasariego.com/testindex.php
Dit is de code:
Werkt niet ! Kijk op Dit is de code:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
$homepage = 'http://'.$_SERVER["HTTP_HOST"].'/';
if ($_REQUEST['act'] == "setLang") {
//check to see if the form has been submitted!
if ($_REQUEST['lang'] == "") {
header('Location: '.$_SERVER["PHP_SELF"]);
//if language selection is empty, redirect to form!
}
else {
//if language was selected, save it in a cookie, then redirect to appropriate page!
$lang = $_REQUEST['lang'];
setcookie("language", $lang, time()+3600);
header('Location: '.$homepage.'/index'.$lang.'.php');
}
}
else {
//if form has not been submitted
if (@$_COOKIE['language'] != "") {
/* check to see if language cookie is empty. If not, redirect to appropriate page. */
header('Location: '.$homepage.'/index'.$_COOKIE["language"].'.php');
}
else {
//if cookie is empty, display form
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<head>
<meta name="verify-v1" content="yPA0Ve6fx977u0ayKKuuGqf6mCaWnwh+F3+HJyHufJo=">
<title>Ceci Casariego: portraits, portrait, interior design, crafts and creations</title>
<meta name="Author" content="Fine arts, portraits and decoration by Ceci Casariego Mazereel">
<meta name="DESCRIPTION" content="Ceci Casariego Mazereel, portraitist, paintor and interior decorator">
<meta name="KEYWORDS" content="cecicasariego,casariegoart,Cecilia,Ceci,Chechu,Laura,Casariego,Mazereel,Bruno,Negrito,Argentina,Argentinie,schilderes,paintor,artist,artiste,pintora,kunstenares,portretkunst,portret,portrait,portretkunstenaar,portretkunstenares,directory,paintings,pinturas,kunst,art,arte,oil,oleo,olie,canvas,doek,tela,paper,papel,papier,ink,tinta,inkt,pastel,acrilico,acrilic,acriel,decoratie,decoration,decoracion,fresco,wallpainting,wood,board,muurschilderijen,interieur,interior,verfeffecten,trompe,loeil,portretten,portraits,retratos,realistic,realistisch,real,fotografisch,photographic,Belgium,Belgica,Belgie,Cambrinus,Damier,hotel,Plenso,Belstat,Outside,Travel,Bert,Lamaire,Unitron,Kwakkelnest,Neerplaats,Deltronic,Nocturnes,Piet,Lesage,Videoland,Poperinge,DHaene,Azart,Kaders,Bonnaffe,Alinia,Nudes,Flemish,Begijnhof,Diest,ExLibris,kunstacademie,kunstakademie,Euro,Region,Euroregion,Miss,verkiezing,election,naaktschilderijen,kunstschilder,portretkunst">
<meta name="ROBOTS" content="NOARCHIVE">
<meta name="REVISIT-AFTER" content="2 days">
<meta name="Classification" content="Artist,decorator,portraitist">
<meta name="language" content="English,Nederlands,Franais">
<meta name="doc-type" content="Public">
<meta name="doc-class" content="Completed">
<meta name="doc-rights" content="Copy Written Work">
<meta name="resource-type" content="document">
<meta name="generator" content="Developed by Bruno Mazereel">
<meta name="distribution" content="Global">
<meta name="rating" content="General">
<meta name="copyright" content="Ceci and Bruno Casariego-Mazereel">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="all" type="text/css" href="site.css">
<meta http-equiv="imagetoolbar" content="no">
<script src="links.js" type="text/javascript"></script>
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
</head>
<body>
<div id="header-main">
<div id="header">
<h1>Ceci CASARIEGO</h1>
<ul>
<li class="nav"><a href="indexNL.php">Nederlands</a></li>
<li class="nav"><a href="indexGB.php">English</a></li>
<li class="nav"><a href="indexFR.php">Français</a></li>
</ul>
</div>
</div>
<div id="body-main">
<div id="body">
<div id="left">
</div>
<div id="right" style="border-bottom:2px solid #cccccc;">
</div>
</div>
</div>
</body>
</html>
<?php
}
}
?>
$homepage = 'http://'.$_SERVER["HTTP_HOST"].'/';
if ($_REQUEST['act'] == "setLang") {
//check to see if the form has been submitted!
if ($_REQUEST['lang'] == "") {
header('Location: '.$_SERVER["PHP_SELF"]);
//if language selection is empty, redirect to form!
}
else {
//if language was selected, save it in a cookie, then redirect to appropriate page!
$lang = $_REQUEST['lang'];
setcookie("language", $lang, time()+3600);
header('Location: '.$homepage.'/index'.$lang.'.php');
}
}
else {
//if form has not been submitted
if (@$_COOKIE['language'] != "") {
/* check to see if language cookie is empty. If not, redirect to appropriate page. */
header('Location: '.$homepage.'/index'.$_COOKIE["language"].'.php');
}
else {
//if cookie is empty, display form
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<head>
<meta name="verify-v1" content="yPA0Ve6fx977u0ayKKuuGqf6mCaWnwh+F3+HJyHufJo=">
<title>Ceci Casariego: portraits, portrait, interior design, crafts and creations</title>
<meta name="Author" content="Fine arts, portraits and decoration by Ceci Casariego Mazereel">
<meta name="DESCRIPTION" content="Ceci Casariego Mazereel, portraitist, paintor and interior decorator">
<meta name="KEYWORDS" content="cecicasariego,casariegoart,Cecilia,Ceci,Chechu,Laura,Casariego,Mazereel,Bruno,Negrito,Argentina,Argentinie,schilderes,paintor,artist,artiste,pintora,kunstenares,portretkunst,portret,portrait,portretkunstenaar,portretkunstenares,directory,paintings,pinturas,kunst,art,arte,oil,oleo,olie,canvas,doek,tela,paper,papel,papier,ink,tinta,inkt,pastel,acrilico,acrilic,acriel,decoratie,decoration,decoracion,fresco,wallpainting,wood,board,muurschilderijen,interieur,interior,verfeffecten,trompe,loeil,portretten,portraits,retratos,realistic,realistisch,real,fotografisch,photographic,Belgium,Belgica,Belgie,Cambrinus,Damier,hotel,Plenso,Belstat,Outside,Travel,Bert,Lamaire,Unitron,Kwakkelnest,Neerplaats,Deltronic,Nocturnes,Piet,Lesage,Videoland,Poperinge,DHaene,Azart,Kaders,Bonnaffe,Alinia,Nudes,Flemish,Begijnhof,Diest,ExLibris,kunstacademie,kunstakademie,Euro,Region,Euroregion,Miss,verkiezing,election,naaktschilderijen,kunstschilder,portretkunst">
<meta name="ROBOTS" content="NOARCHIVE">
<meta name="REVISIT-AFTER" content="2 days">
<meta name="Classification" content="Artist,decorator,portraitist">
<meta name="language" content="English,Nederlands,Franais">
<meta name="doc-type" content="Public">
<meta name="doc-class" content="Completed">
<meta name="doc-rights" content="Copy Written Work">
<meta name="resource-type" content="document">
<meta name="generator" content="Developed by Bruno Mazereel">
<meta name="distribution" content="Global">
<meta name="rating" content="General">
<meta name="copyright" content="Ceci and Bruno Casariego-Mazereel">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="all" type="text/css" href="site.css">
<meta http-equiv="imagetoolbar" content="no">
<script src="links.js" type="text/javascript"></script>
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
</head>
<body>
<div id="header-main">
<div id="header">
<h1>Ceci CASARIEGO</h1>
<ul>
<li class="nav"><a href="indexNL.php">Nederlands</a></li>
<li class="nav"><a href="indexGB.php">English</a></li>
<li class="nav"><a href="indexFR.php">Français</a></li>
</ul>
</div>
</div>
<div id="body-main">
<div id="body">
<div id="left">
</div>
<div id="right" style="border-bottom:2px solid #cccccc;">
</div>
</div>
</div>
</body>
</html>
<?php
}
}
?>
nou bij mij laat hij wel de content met de geslecterde taal zien als dat is wat je wil ?!
Dat is de bedoeling: dat je bij volgend bezoek direct naar de eerder gekozen taal gaat.
en als je gaat doorverwijzen doe je wel indexFR.php, maar dat heb je al goed..
Kan iemand me de code verbeteren, aub, met uitleg ?