Now I want to compact all of my code so I don't need to be calling four different pages just to do one thing... I have everything working perfectly besides this issue: Since I no longer have "set.php" on its' own page (it is now integrated into index.php), after a cookie is set, if a user wishes to change the cookie (by clicking a link that is like index.php?ver=en/de), it doesn't change right away...
What I need is the ability to use index.php?ver=en/de to change a cookie and refresh the page... I know a code to refresh the page, but where I place the refresh code, it anally-rapes browsers as it keeps refreshing and refreshing and refreshing...
index.php source code:
Code: Select all
<?php
if($ver == "en") {
setcookie("language", en, time()+604800);
}
else {
setcookie("language", de, time()+604800);
}
//Checking for a Cookie
if(isset($HTTP_COOKIE_VARS['language'])){
//Cookie Set Version
$ver = $HTTP_COOKIE_VARS["language"];
$change = $ver."_flag.jpg";
if($ver == "en") {
$ver2 = "de";
} else {
$ver2 = "en";
}
// Style settings
include($ver.".style.php");
// Page identification
if (isset($id)) {
$id = $id;
} else {
$id = $ver.".news";
}
switch($ver)
{
case 'de':
switch($id)
{
case 'de.link':
case 'de.cont':
$sec_i = 'Wenn Sie diese Netplatz magen, dann hier ist, alles das Sie möchten.';
break;
case 'de.gallery':
$sec_i = 'Schauen Sie durch meinen Galerien und bemängeln Sie mir, dass Sie möchten.';
break;
case 'de.news':
default:
$sec_i = 'Lesen Sie über meinem Leben und machen Sie eiligen Urteile.';
break;
}
break;
case 'en':
default:
switch($id)
{
case 'en.link':
case 'en.cont':
$sec_i = 'If you actually like what is on this site, all the information you need is here.';
break;
case 'en.gallery':
$sec_i = 'Look through snapshots of my life and criticize them as you feel.';
break;
case 'en.news':
default:
$sec_i = 'Read about my eventful life here and make your judgements swiftly.';
break;
}
break;
}
include($ver.".content.php");
} else {
//Setting Cookie
print "
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"
\"http://www.w3.org/TR/html4/strict.dtd\">
<html>
<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\">
<head>
<title>theda</title>
</head>
<body bgcolor=\"#000000\"><table><center><br><br>
<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"640\" HEIGHT=\"480\">
<TR>
<TD ROWSPAN=\"1\" COLSPAN=\"2\" WIDTH=\"640\" HEIGHT=\"432\">
<IMG SRC=\"splash.jpg\" WIDTH=\"640\" HEIGHT=\"432\" BORDER=\"0\"></TD>
</TR>
<TR>
<TD ROWSPAN=\"1\" COLSPAN=\"1\" WIDTH=\"297\" HEIGHT=\"48\">
<A HREF=\"http://dumbass.ionichost.com/set.php?ver=en\"><IMG SRC=\"en_splash.jpg\" WIDTH=\"297\" HEIGHT=\"48\" BORDER=\"0\" ALT=\"English\"></A></TD>
<TD ROWSPAN=\"1\" COLSPAN=\"1\" WIDTH=\"343\" HEIGHT=\"48\">
<A HREF=\"http://dumbass.ionichost.com/set.php?ver=de\"><IMG SRC=\"de_splash.jpg\" WIDTH=\"343\" HEIGHT=\"48\" BORDER=\"0\" ALT=\"Deutsch\"></A></TD>
</TR>
</TABLE>
</center>
</table>
</body>
</html>";
}
?>
<noscript>