Hooi!
Ik heb deze code:En de website ziet er zo uit:
Afbeelding niet beschikbaarDe bron kon niet worden geladen (www.habbotjes.be).Bron openen ↗
Wat doe ik fout?
//Oja Gelukkig nieuwjaar vast!
Ik heb deze code:
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])){[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]act[/COLOR][COLOR= #007700]]==[/COLOR][COLOR= #DD0000]"bekijken"[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$rr[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM cadeau WHERE geopend=Ja AND id="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$rr[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]De troffee dat je wilde bekijken is nog niet opengemaakt of deze bestaat niet[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$rr[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$naam[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR]htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]van[/COLOR][COLOR= #007700]]));[/COLOR]
[COLOR= #0000BB]$lid[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM leden WHERE gebruikersnaam = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$naam[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$gebruiker[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$lid[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]troffee[/COLOR][COLOR= #007700]]==[/COLOR][COLOR= #DD0000]"brons"[/COLOR][COLOR= #007700]) {[/COLOR]
?>
<html>
<center><table width="294" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="294" height="22" colspan="3" background="images/brons_01.gif"></td>
</tr>
<tr>
<td width="5" background="images/brons_02.gif" rowspan="3"></td>
<td width="285" bgcolor="#B87834" valign="top">[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]);[/COLOR]?></td>
<td width="4" background="images/brons_04.gif" rowspan="3"></td>
</tr>
<tr>
<td width="285" bgcolor="#B87834" align="center" height="8"><img border="0" src="images/brons_06.gif" width="252" height="4"></td>
</tr>
<tr>
<td width="285" bgcolor="#B87834" valign="top">Gekregen van: <a href="?p=profiel&mid=[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$gebruiker[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]member_id[/COLOR][COLOR= #007700]];[/COLOR]?>">[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]van[/COLOR][COLOR= #007700]]);[/COLOR]?></a></td>
</tr>
<tr>
<td width="294" height="14" colspan="3" background="images/brons_05.gif"></td>
</tr>
</table>
</center>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]troffee[/COLOR][COLOR= #007700]]==[/COLOR][COLOR= #DD0000]"zilver"[/COLOR][COLOR= #007700]) {[/COLOR]
?>
<center><table width="294" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="294" height="22" colspan="3" background="images/zilver_01.gif"></td>
</tr>
<tr>
<td width="5" background="images/zilver_02.gif" rowspan="3"></td>
<td width="285" bgcolor="#C9BDCC" valign="top">[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]);[/COLOR]?></td>
<td width="4" background="images/zilver_04.gif" rowspan="3"></td>
</tr>
<tr>
<td width="285" bgcolor="#C9BDCC" align="center" height="8"><img border="0" src="images/zilver_06.gif" width="252" height="4"></td>
</tr>
<tr>
<td width="285" bgcolor="#C9BDCC" valign="top">Gekregen van: <a href="?p=profiel&mid=[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$gebruiker[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]member_id[/COLOR][COLOR= #007700]];[/COLOR]?>">[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]van[/COLOR][COLOR= #007700]]);[/COLOR]?></a></td>
</tr>
<tr>
<td width="294" height="14" colspan="3" background="images/zilver_05.gif"></td>
</tr>
</table>
</center>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]troffee[/COLOR][COLOR= #007700]]==[/COLOR][COLOR= #DD0000]"goud"[/COLOR][COLOR= #007700]) {[/COLOR]
?>
<center><table width="294" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="294" height="22" colspan="3" background="images/goud_01.gif"></td>
</tr>
<tr>
<td width="5" background="images/goud_02.gif" rowspan="3"></td>
<td width="285" bgcolor="#ECC547" valign="top">[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]);[/COLOR]?></td>
<td width="4" background="images/goud_04.gif" rowspan="3"></td>
</tr>
<tr>
<td width="285" bgcolor="#ECC547" align="center" height="8"><img border="0" src="images/goud_06.gif" width="252" height="4"></td>
</tr>
<tr>
<td width="285" bgcolor="#ECC547" valign="top">Gekregen van: <a href="?p=profiel&mid=[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$gebruiker[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]member_id[/COLOR][COLOR= #007700]];[/COLOR]?>">[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]van[/COLOR][COLOR= #007700]]);[/COLOR]?></a></td>
</tr>
<tr>
<td width="294" height="14" colspan="3" background="images/goud_05.gif"></td>
</tr>
</table></center>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}}
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
?>
<table width=500><tr>
<td><span style="font-weight: bold;">Van</span></td>
<td><span style="font-weight: bold;">Naar</span></td>
<td><span style="font-weight: bold;">Troffee</span></td>
<td><span style="font-weight: bold;"> X </span></td>
</tr>
[COLOR= #0000BB]<?php
$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM cadeau WHERE geopend=Ja"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<b><font color="red">Er zijn nog geen cadeaus geopend</font></f>[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/else"]else[/URL]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700])){[/COLOR]
[COLOR= #0000BB]$naam[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR]htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]van[/COLOR][COLOR= #007700]]));[/COLOR]
[COLOR= #0000BB]$lid[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM leden WHERE gebruikersnaam = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$naam[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$gebruiker[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$lid[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$naam2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR]htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naar[/COLOR][COLOR= #007700]]));[/COLOR]
[COLOR= #0000BB]$lid2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM leden WHERE gebruikersnaam = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$naam2[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$gebruiker2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$lid2[/COLOR][COLOR= #007700]);[/COLOR]
?>
<tr>
<td><a href="?p=profiel&mid=[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$gebruiker[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]member_id[/COLOR][COLOR= #007700]];[/COLOR]?>">[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]van[/COLOR][COLOR= #007700]]);[/COLOR]?></a></td>
<td><a href="?p=profiel&mid=[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$gebruiker2[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]member_id[/COLOR][COLOR= #007700]];[/COLOR]?>">[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naar[/COLOR][COLOR= #007700]]);[/COLOR]?></a></td>
<td><img src="images/[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$rij[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]troffee[/COLOR][COLOR= #007700]];[/COLOR] ?>.gif" /></td>
<td><a href="?p=cadeau&act=bekijken&id=[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$rij[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]);[/COLOR]?>">Troffee bekijken</a></td></tr>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?>[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?>[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je bent niet ingelogd."[/COLOR][COLOR= #007700];
}[/COLOR]
?>
Afbeelding niet beschikbaarDe bron kon niet worden geladen (www.habbotjes.be).Bron openen ↗Wat doe ik fout?
//Oja Gelukkig nieuwjaar vast!

