Skal have tilføjet en if
HejEr der en der kan tilføje denne if til resten af min kode:
if($_SESSION['bruger_id'] == $row['bruger_id']) {
echo '<br><center><span class="fed_tekst">Du kan ikke bedømme din egen bil.</span></center><br>';
}
Resten af min kode:
if($_SESSION['logget_ind'] == '1') {
$bruger_id = $_SESSION['bruger_id'];
$query = mysql_query("SELECT COUNT(id) FROM galleri_bedoemmelser WHERE bil_id = '$id' AND bruger_id = '$bruger_id'");
$row = mysql_fetch_row($query);
$antal = $row[0];
if($antal > 0) {
$query2=mysql_query("SELECT bedoemmelse FROM galleri_bedoemmelser WHERE bil_id = '$id' AND bruger_id = '$bruger_id'");
while($row2 = mysql_fetch_array($query2)) {
if($_GET['ret_bedoemmelse'] == '1') {
echo '<form method="POST" action="'.$_SERVER['REQUEST_URI'].'">
<center><select size="1" name="ret_bedoemmelse" class="form_input">
<option></option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select>
<input type="submit" value="Ret" class="form_knap">
</center></form>';
} else {
echo '<br><center><span class="fed_tekst">Du har givet denne bil '.$row2['bedoemmelse'].' ud af 10 -</span> <span class="tekst"><a href="index.php?s=galleri_vis_bil&id='.$id.'&ret_bedoemmelse=1">Ret Bedømmelse</a></span></center><br>';
echo '';
}
}
} else {
echo '<form method="POST" action="'.$_SERVER['REQUEST_URI'].'">
<center><select size="1" name="bedoemmelse" class="form_input">
<option></option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select>
<input type="submit" value="Bedøm" class="form_knap">
</center></form>';
}
} else {
echo '<br><center><span class="fed_tekst">Du skal være logget ind for at kunne bedømme.</span></center><br>';
}