PHP Witte pagina

Gestart doorJeffreyy20 reacties71 weergaven

21 berichten · pagina 1 van 2

Jeffreyy

Lid · Topicstarter

Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hey,

Ik ben weer eens aan het scripten, even me kennis terug ophalen, nu heb ik net het systeem wat Kjeld me gaf ik me vorige topic ingebouwd, maar ik zit nu met een probleem.

Ik krijg namelijk een witte pagina, zonder dat ik een fout krijg.
Dit heb ik bij elke fout die ik maak, dus het wordt steeds moeilijker om op te lossen.

Kan iemand vertellen hoe ik php weer de fout aan laat geven?

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]../includes/config.inc.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]../includes/admin_boven.inc.php[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL[COLOR= #007700]);[/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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]a[/COLOR][COLOR= #007700]])) {[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/in_array"]in_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]a[/COLOR][COLOR= #007700]],[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]up[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]down[/COLOR][COLOR= #007700])) &&[/COLOR] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])) {[/COLOR]
        [COLOR= #0000BB]$qQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT id, plaats FROM paginas 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]$_GET[/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]
        [COLOR= #0000BB]$qFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qQuery[/COLOR][COLOR= #007700]);[/COLOR]
        
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]a[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"up"[/COLOR][COLOR= #007700]) {[/COLOR]
            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE paginas SET plaats = plaats+1 WHERE plaats = "[/COLOR][COLOR= #007700].([/COLOR][COLOR= #0000BB]$qFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]plaats[/COLOR][COLOR= #007700]] -[/COLOR] [COLOR= #0000BB]1[/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]"UPDATE paginas SET plaats = plaats-1 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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/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/else"]else[/URL] [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE paginas SET plaats = plaats-1 WHERE plaats = "[/COLOR][COLOR= #007700].([/COLOR][COLOR= #0000BB]$qFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]plaats[/COLOR][COLOR= #007700]] +[/COLOR] [COLOR= #0000BB]1[/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]"UPDATE paginas SET plaats = plaats+1 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]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/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]
?>
            <h1>Pagina beheer</h1>
            <p>
                Vanuit deze pagina, kunt u elke toegevoegde pagina beheren, indien u een contactformulier of andere module wilt invoegen, dient u deze zelf te maken.
            </p>
            <span class="newpage">
                <a href="nieuwepagina">Nieuwe pagina</a>
            </span>
            [COLOR= #0000BB]<?php
            $qQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM paginas WHERE `delete` = 0 ORDER BY plaats ASC"[/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]$qQuery[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="error">Er zijn geen paginas gevonden</div>[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
                [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qQuery[/COLOR][COLOR= #007700])) {[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000] 
                        <div class="page">
                            <div class="pageleft">
                                [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$qFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]
                            </div>
                            <div class="pageright">
                                <img src="images/view.png" title="Bekijk pagina" />
                                <a href="paginabewerken?id=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$qFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"><img src="images/edit.png" title="Bewerk pagina" /></a>
                                <img src="images/delete.png" title="Verwijder pagina" />
                                <a href="?id=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$qFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]&a=up"><img src="images/arrow_up.png" title="Verplaats omhoog" /></a>
                                <a href="?id=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$qFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]&a=down"><img src="images/arrow_down.png" title="Verplaats omlaag" /></a>
                            </div>
                        </div>
                    [/COLOR][COLOR= #007700];
                }
            }[/COLOR]
            
            ?>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]../includes/admin_onder.inc.php[/COLOR][COLOR= #007700];[/COLOR]
?>


Btw, niet letten op foutafhandelingen, ik werk tijdens het ontwikkelen met die();
Dit zet ik later weer om.
0
Berichten
6.201
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik zie zo ff geen fouten, maar je hebt wel op regel 9 je id tussen quotes staan.
Lijkt me sowieso niet dat dit er iets mee te maken heeft, maar toch yummie
0
Berichten
308
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Controleer of je nergens n die(); exit() functie hebt staan.
Controleer je config of er nergens fouten veroorzaken.

Normaal gezien zou je a.d.v. error_reporting(E_ALL) alle foutmeldingen te zien krijgen.
Controleer dus of er nergens (eventueel) config bestand, error_reporting(0); staat of iets anders.

Als je niets vind, heb je misschien error_log.txt staan ?
Daar kan je alle fouten zien.

Succes wink
0
Jeffreyy

Lid · Topicstarter

Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Robbeing schreef:
Controleer of je nergens n die(); exit() functie hebt staan.
Controleer je config of er nergens fouten veroorzaken.

Normaal gezien zou je a.d.v. error_reporting(E_ALL) alle foutmeldingen te zien krijgen.
Controleer dus of er nergens (eventueel) config bestand, error_reporting(0); staat of iets anders.

Als je niets vind, heb je misschien error_log.txt staan ?
Daar kan je alle fouten zien.

Succes wink
Die en exit staat nergens, al gecontroleerd, ook in de config staan geen fouten, daar staat de reporting ook op E_ALL, ik zal eens in de error_log kijken
0
Berichten
308
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Regel 13: mysql_query("UPDATE paginas SET plaats = plaats+1 WHERE plaats = ".($qFetch[plaats] - 1)

Ben je een ) vergeten dus als volgt.

mysql_query("UPDATE paginas SET plaats = plaats+1 WHERE plaats = ".($qFetch[plaats] - 1))
0
Jeffreyy

Lid · Topicstarter

Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bedankt, nu werkt hij weer.

Maar ik vraag me nog steeds af waarom hij geen errors weergeeft
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Is het lokaal? Gebruik je MAMP? Want MAMP kan dat niet.
0
Berichten
308
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jponsen schreef:
Bedankt, nu werkt hij weer.

Maar ik vraag me nog steeds af waarom hij geen errors weergeeft
Mooizo, blij dat het nu werkt biggrin
0
Jeffreyy

Lid · Topicstarter

Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rogier schreef:
Is het lokaal? Gebruik je MAMP? Want MAMP kan dat niet.
Is gewoon op me host, dat is het rare juist
0
Berichten
5.795
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
het kan ook zijn dat er een .htaccess bestand is in de root van je host daar staan vaak ook php configuraties in waar error reporting bijvoorbeeld uit staat
0
Jeffreyy

Lid · Topicstarter

Berichten
6.144
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ook al naar gekeken, deze hoort ze gewoon te weergeven
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
display_errors(1)

Kan ook op 0 staat, weergeeft ie ook geen errors
0
Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

Waat host je op?
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
error_reporting(E_ALL); moet helemaal bovenaan je script, dus onder
display_errors() is geen bestaande functie, je bedoelt dit:
ini_set(display_errors, 1);
en dat moet boven je erorr reporting maar onder
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je host kan fout-weergave uit hebben staan en dan werkt display_errors ook niet als het om een FATAL error gaat, wat het in dit geval is
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