Website raar door php code?

Gestart doorMarvinn12 reacties26 weergaven

13 berichten · pagina 1 van 1

Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hooi!

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]
?>
En de website ziet er zo uit:
Afbeelding

Wat doe ik fout?

//Oja Gelukkig nieuwjaar vast!pompom
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat nou rippen ik rip niet eens?
0
Berichten
237
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Inderdaad Fanorg smile
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik rip niet eens -,0
0
Berichten
237
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Haha epic fail
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat rip ik dan?
0
Berichten
994
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Table staat niet goed.
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik snap dat tabel niet?

Wat is er verkeert dan?
0
Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
topic even opgeschoond, graag alleen berichtjes die de TS helpen, van die kinderachtige opmerkingen houden jullie voortaan maar voor je. Ontopic dus...

je laatste table sluit je niet af

<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></table> < deze
[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]
?>
0
Berichten
994
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je vergeet dingen af te sluiten.
0
Berichten
237
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nickjexx schreef:
Ik snap dat tabel niet?
Wat is er verkeert dan?

Haal alles van de tabel weg, heb ik ook gedaan.

Offtopic:
Waarom maak je dan een site..

EDIT:
Wat hij hierboven zegt kan ook.
0
Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoeft niet, hij heeft de onderste tabel niet afgesloten.
0
Marvinn

Lid · Topicstarter

Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jponsen schreef:
Hoeft niet, hij heeft de onderste tabel niet afgesloten.
Bedankt het werkt! smile
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren