Ik krijg een blanco pagina.

Gestart doorOne2xs27 reacties78 weergaven

28 berichten · pagina 2 van 2

Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
0.o wel dan zal ik er strak over 40 minutes nog eens naar kijken.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Haal ik die met privatemessage etc. eruit haal doet hij het wel, de fout zit hem dus daarin!

toevoeging op 29 februari 2012, 201852:
Iemand een idee?
0
Berichten
15.446
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
in mijn code had ik ook wat aangepast aan de $refmessage had je die ook veranderd?
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
IK heb alles wat jij schreef aangepast
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
if(isset($_POST[submit])){
Dit is niet de juiste manier. Gebruik dit:

if($_SERVER[REQUEST_METHOD]=="POST") {

Tevens ontbreekt goede foutafhandeling. Een script hoort NIET (ik herhaal NIET) te sterven als er iets fout gaat. Dat doen mensen normaal toch ook niet, als ze iets fout doen?

Ook raad ik aan om bovenaan te plaatsen:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL[COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/ini_set"]ini_set[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]display_errors[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]
?>


En benut de tab-toets eens bij if-else statements.
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat van hoeft niet te sterven vergelijken met ons sm_eerie ik heb het nog al gezien en het is redelijk stom. Als je zelf een error wilt geven zoals bv op youtube zijn er niet veel keuzes.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Hoe bedoel je, zoals op Youtube?
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb het al iets mooier uitgelijnd want man wat een bagger script.
Anyway het zit hem wss in die or die dus export de database structuur van privatemessages eens.
*edit*
De eerste ufetch staat nu na de else, anders gaat het een error geven.

[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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]])){[/COLOR]

    [COLOR= #0000BB]$uQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE username = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/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]$uQuery[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
        {[/COLOR]

        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div id="error">Dit lid bestaat niet!</div>[/COLOR][COLOR= #007700];

        }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        [COLOR= #0000BB]$uFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uQuery[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE users SET waarschuwing = waarschuwing+"[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]erbij[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/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/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO waarschuwingen (userid, reden, procenten) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]reden[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]erbij[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]")"[/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]

        [COLOR= #0000BB]$refmessage[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Hoi,<br />
        <br />
        Zojuist heb je een waarschuwing ontvangen, met de volgende reden:<br />
        <b>[/COLOR][COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]reden[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]</b><br />
        <br />
        Je krijgt hierdoor <b>[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]erbij[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]%</b> bij je waarschuwingsniveau.<br />
        Als jij 100% krijgt dan krijg jij een permanente ban!<br />
        <br />
        Groeten,<br />
        meljel2[/COLOR][COLOR= #007700];[/COLOR]

        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO privatemessages VALUES (
        NULL,
        1,
        "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]",
        "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$refmessage[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]",
        0,
        NOW(),
        Waarschuwing (+"[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]erbij[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]"%)
        );
        "[/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/echo"]echo[/URL] [COLOR= #DD0000]<div id="succes">Waarschuwingsniveau toegevoegd!</div>[/COLOR][COLOR= #007700];
    }
    }[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]

?>

<br />

Geef hieronder de gebruikersnaam in van de gebruiker die je een waarschuwing wilt geven.<br /><br />

<form method="post" action="?p=admin_warning">
<table style="border: 0;">
<tr>
<td style="width: 210px;">
Gebruikersnaam:
</td>
<td>
<input type="text" name="username" />
</td>
</tr>
<tr>
<td style="width: 210px;">
Waarschuwingsniveau erbij doen:
</td>
<td>
<input type="text" name="erbij" />
</td>
</tr>
<tr>
<td style="width: 210px;">
Reden:
</td>
<td>
<input type="text" name="reden" />
</td>
</tr>
</table><br /><br />
<input type="submit" name="submit" value="Geef waarschuwingsniveau" />
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?>


toevoeging op 29 februari 2012, 21:01:06:
Aarclay schreef:
Hoe bedoel je, zoals op Youtube?
Daar geven ze ook zon mooie error als de database niet werkt en dat is dus niet met error reporting. Maar daar gaat het niet over, dus ga even weer on topic. Die is niet slecht, ik gebruik het ook niet maar als je het leuk vindt dan moet je het gewoon gebruiken.
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Alemaalte schreef:
Ik heb het al iets mooier uitgelijnd want man wat een bagger script.
Anyway het zit hem wss in die or die dus export de database structuur van privatemessages eens.
*edit*
De eerste ufetch staat nu na de else, anders gaat het een error geven.
[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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]])){[/COLOR]

    [COLOR= #0000BB]$uQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE username = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/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]$uQuery[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
        {[/COLOR]

        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div id="error">Dit lid bestaat niet!</div>[/COLOR][COLOR= #007700];

        }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        [COLOR= #0000BB]$uFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uQuery[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE users SET waarschuwing = waarschuwing+"[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]erbij[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/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/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO waarschuwingen (userid, reden, procenten) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]reden[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]erbij[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]")"[/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]

        [COLOR= #0000BB]$refmessage[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Hoi,<br />
        <br />
        Zojuist heb je een waarschuwing ontvangen, met de volgende reden:<br />
        <b>[/COLOR][COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]reden[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]</b><br />
        <br />
        Je krijgt hierdoor <b>[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]erbij[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]%</b> bij je waarschuwingsniveau.<br />
        Als jij 100% krijgt dan krijg jij een permanente ban!<br />
        <br />
        Groeten,<br />
        meljel2[/COLOR][COLOR= #007700];[/COLOR]

        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO privatemessages VALUES (
        NULL,
        1,
        "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$uFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]",
        "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$refmessage[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]",
        0,
        NOW(),
        Waarschuwing (+"[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]erbij[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]"%)
        );
        "[/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/echo"]echo[/URL] [COLOR= #DD0000]<div id="succes">Waarschuwingsniveau toegevoegd!</div>[/COLOR][COLOR= #007700];
    }
    }[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]

?>

<br />

Geef hieronder de gebruikersnaam in van de gebruiker die je een waarschuwing wilt geven.<br /><br />

<form method="post" action="?p=admin_warning">
<table style="border: 0;">
<tr>
<td style="width: 210px;">
Gebruikersnaam:
</td>
<td>
<input type="text" name="username" />
</td>
</tr>
<tr>
<td style="width: 210px;">
Waarschuwingsniveau erbij doen:
</td>
<td>
<input type="text" name="erbij" />
</td>
</tr>
<tr>
<td style="width: 210px;">
Reden:
</td>
<td>
<input type="text" name="reden" />
</td>
</tr>
</table><br /><br />
<input type="submit" name="submit" value="Geef waarschuwingsniveau" />
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?>


toevoeging op 29 februari 2012, 21:01:06:
Aarclay schreef:
Hoe bedoel je, zoals op Youtube?
Daar geven ze ook zon mooie error als de database niet werkt en dat is dus niet met error reporting. Maar daar gaat het niet over, dus ga even weer on topic. Die is niet slecht, ik gebruik het ook niet maar als je het leuk vindt dan moet je het gewoon gebruiken.

Nu werkt hij! Bedankt.
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb helemaal niets veranderd, ben je zeker dat je mijn eerste script wel hebt uitgeprobeerd? aah
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Alemaalte schreef:
Eerdere citaten tonen
Aarclay schreef:
Hoe bedoel je, zoals op Youtube?
Daar geven ze ook zon mooie error als de database niet werkt en dat is dus niet met error reporting. Maar daar gaat het niet over, dus ga even weer on topic. Die is niet slecht, ik gebruik het ook niet maar als je het leuk vindt dan moet je het gewoon gebruiken.
Werk je bij Youtube? Heb je hun code ooit eens gezien?
Hoe weet je zeker dat het zo is wat je nu vertelt?

Iets met een klok en een klepel?
0
Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Het is maar een ideeeee hoor.
maar je zou dit kunnen beveiligen :http://thahab.nl/index.php?p=admin_warning
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