Witam próbując zrobić głosowanie pojawia się błąd. Jakieś pomysły jak to naprawić?
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
<form name="glosy" method="get" action="glosowanie.php">
<center>
<table class="tabela">
<h1><center><th><b>Która gra jest dla Ciebie najlepsza?</b></center></h1>
<br><br>
<input type="radio" name="glos" value="fifa">Fifa 18
<br>
<input type="radio" name="glos" value="bf">Battlefield 1
<br>
<input type="radio" name="glos" value="pubg">Playerunknown's Battlegrounds
<br>
<input type="radio" name="glos" value="csgo">Counter-Strike: Global Offensive
<br><br><br>
<input type="submit" value="Oddaj głos">
</th>
</table>
<br>
<a href="podsumowanie.php">Zobacz wyniki głosowania(Tego jak na razie nie ma)</a></center>
</body>
</html>
<?php
switch($_GET['glos']){
case "fifa":
$fifa = fopen("fifa.txt", "r+");
$count = fgets($fifa);
$count = $count + 1;
fseek($fifa, 0);
fputs($fifa, $count);
fclose($fifa);
break;
}
switch($_GET['glos']){
case "bf":
$bf = fopen("bf.txt", "r+");
$count = fgets($bf);
$count = $count + 1;
fseek($bf, 0);
fputs($bf, $count);
fclose($bf);
break;
}
switch($_GET['glos']){
case "pubg":
$fifa = fopen("pubg.txt", "r+");
$count = fgets($pubg);
$count = $count + 1;
fseek($pubg, 0);
fputs($pubg, $count);
fclose($pubg);
break;
}
switch($_GET['glos']){
case "csgo":
$fifa = fopen("csgo.txt", "r+");
$count = fgets($csgo);
$count = $count + 1;
fseek($csgo, 0);
fputs($csgo, $count);
fclose($csgo);
break;
}
?>
Dodam że głosując na fifę i csa wszystko działa a dalej jest tak jak na screenie wyżej