Jeg har lavet denne kode:
<?
include("../config.php");
//Ændre $har_stemt3 til f.eks $dinside
if($har_stemt){
//Henter design
$db = mysql_connect("$hostname", "$username", "$password");
mysql_select_db("$database", $db);
$foresp = mysql_query("SELECT * FROM webdeskup_theme WHERE valg = 'ON' ORDER
BY nr DESC");
while($data = mysql_fetch_array($foresp)){
include("../Theme/$data[2]/Style/theme.php");
echo "<html>
<head>
<META HTTP-EQUIV=\"Refresh\" CONTENT=\"3;URL=poll.php?mode=vis\">
<title>$data[3]</title>
<link rel=\"stylesheet\" type=\"text/css\"
href=\"../Theme/$data[2]/Style/style.css\">
<link rel=\"stylesheet\" type=\"text/css\"
href=\"../Theme/$data[2]/Style/stylemenu.css\">";
$pollimg = $data[2];
}
echo "<br><br><table align=\"center\" width=\"50%\"><tr><td><p
class=\"vidrestil\">Beklager, du har stemt en gang
før.</td></tr></table></p><p class=\"understil\">Hvis denne side ikke
omstilles automatisk, tryk <a href=\"poll.php?mode=vis\">her</a>";
}else{
?><?
//Ændre $har_stemt3 til det du skrev oven over f.eks !$dinside
//Ændre har_stemt3 til det du skrev oven over f.eks dinside
setcookie("har_stemt", 1, time()+ 30758400);
include("../config.php");
//Henter design
$db = mysql_connect("$hostname", "$username", "$password");
mysql_select_db("$database", $db);
$forespe = mysql_query("SELECT * FROM webdeskup_theme WHERE valg = 'ON'
ORDER BY nr DESC");
while($data = mysql_fetch_array($forespe)){
include("../Theme/$data[2]/Style/theme.php");
echo "<html>
<head>
<META HTTP-EQUIV=\"Refresh\" CONTENT=\"3;URL=poll.php?mode=vis\">
<title>$data[3]</title>
<link rel=\"stylesheet\" type=\"text/css\"
href=\"../Theme/$data[2]/Style/style.css\">
<link rel=\"stylesheet\" type=\"text/css\"
href=\"../Theme/$data[2]/Style/stylemenu.css\">";
}
echo "<br><br><table align=\"center\" width=\"50%\"><tr><td><p
class=\"vidrestil\">Din stemme er modtaget!</td></tr></table></p><p
class=\"understil\">Hvis denne side ikke omstilles automatisk, tryk <a
href=\"users.php?mode=user_forside\">her</a>";
//Kontakter databasen
$db = mysql_connect("$hostname", "$username", "$password");
mysql_select_db("$database", $db);
$forespe = mysql_query("SELECT * FROM webdeskup_poll ORDER BY nr DESC");
while($data = mysql_fetch_array($forespe)){
$plusen01 = $data[6]+1;
$plusen02 = $data[7]+1;
$plusen03 = $data[8]+1;
$plusen04 = $data[9]+1;
$plusen05 = $data[11]+1;
$plusen06 = $data[13]+1;
$plusen07 = $data[15]+1;
$plusen08 = $data[17]+1;
$plusen09 = $data[19]+1;
$plusen10 = $data[21]+1;
}
$stem = $_REQUEST['stem'];
if($stem == 'stem01'){
mysql_query("UPDATE webdeskup_poll Set stem01 = '$plusen01'");
}
if($stem == 'stem02'){
mysql_query("UPDATE webdeskup_poll Set stem02 = '$plusen02'");
}
if($stem == 'stem03'){
mysql_query("UPDATE webdeskup_poll Set stem03 = '$plusen03'");
}
if($stem == 'stem04'){
mysql_query("UPDATE webdeskup_poll Set stem04 = '$plusen04'");
}
if($stem == 'stem05'){
mysql_query("UPDATE webdeskup_poll Set stem05 = '$plusen05'");
}
if($stem == 'stem06'){
mysql_query("UPDATE webdeskup_poll Set stem06 = '$plusen06'");
}
if($stem == 'stem07'){
mysql_query("UPDATE webdeskup_poll Set stem07 = '$plusen07'");
}
if($stem == 'stem08'){
mysql_query("UPDATE webdeskup_poll Set stem08 = '$plusen08'");
}
if($stem == 'stem09'){
mysql_query("UPDATE webdeskup_poll Set stem09 = '$plusen09'");
}
if($stem == 'stem10'){
mysql_query("UPDATE webdeskup_poll Set stem10 = '$plusen10'");
}
}
?>
Den virker fint på
www.webdeskup.1go.dk, men på
www.storkie.dk kan den ikke
finde cookien. Hvad skyldes? Er det en fejl i min kode?
MVH
Michael