Help Wouter met zn PHP problemen

Gestart doorWouterp19 reacties24 weergaven

20 berichten · pagina 1 van 2

Wouterp

Lid · Topicstarter

Berichten
1.631
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heey,

Ik heb een probleempje. Als ik mijn notitie heb geupdated krijg je de notitie van voordat die was verstuurt als je de pagina refresh krijg je hem wel goed voorbeeld:
http://www.letsweb.nl/klant/kladblok.php
Wachtwoord + naam is test1
Refresh functie kan niet i.v.m. de headers.

M.v.g. Wouter
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
De UPDATE boven de SELECT smile
0
Wouterp

Lid · Topicstarter

Berichten
1.631
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je bent geweldig. Waarom moes dat?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Alles werkt zo te zien/
0
Thom

Lid

Berichten
10.654
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Goededag schreef:
Je bent geweldig. Waarom moes dat?
Je wilt anders iets uit de database wat nog niet veranderd is..
0
Wouterp

Lid · Topicstarter

Berichten
1.631
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nu je het zo stelt klinkt het logisch

toevoeging op 11 februari 2012, 22:06:59:
Nu nieuw probleem

regel 33

$email = mysql_result(mysql_query("SELECT email FROM gebruikers WHERE id = ".$_SESSION[gebruiker]),0);


error:

<br /><b>Warning</b>:  htmlentities() expects parameter 1 to be string, resource given in <b>/home/goededag/domains/letsweb.nl/public_html/klant/controlpaneel.php</b> on line <b>40</b><br />
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Goededag schreef:
Nu je het zo stelt klinkt het logisch
toevoeging op 11 februari 2012, 22:06:59:
Nu nieuw probleem

regel 33

$email = mysql_result(mysql_query("SELECT email FROM gebruikers WHERE id = ".$_SESSION[gebruiker]),0);


error:

Warning: htmlentities() expects parameter 1 to be string, resource given in /home/goededag/domains/letsweb.nl/public_html/klant/controlpaneel.php on line 40

Hier zijn we lekker veel mee confused
0
Thom

Lid

Berichten
10.654
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik weet niet of je kan lezen..
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thommiee schreef:
Ik weet niet of je kan lezen..
Ik ook niet, dat probleem heb ik wel eens vaker. Wat ben ik vergeten te lezen?
0
Wouterp

Lid · Topicstarter

Berichten
1.631
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat wil je nogmeer dan -.-
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Post een het hele script, dan kunnen we dat nakijken.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Goededag schreef:
Wat wil je nogmeer dan -.-
Regel 33 is niks mis mee?
Hij geeft error op 40 aan, geef alles eens rondom lijn 40.
Lijn 35 tot 45 o.i.d.
0
Wouterp

Lid · Topicstarter

Berichten
1.631
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/require"]require[/URL] [COLOR= #DD0000]connect.php[/COLOR][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]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruiker[/COLOR][COLOR= #007700]])) {[/COLOR]   
    [COLOR= #FF8000]// E-mailadres bijwerken:   
    // De variabele fout aanmaken om fouten ivm undefined variable te voorkomen   [/COLOR]
    [COLOR= #0000BB]$fout[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR]   
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700]) {[/COLOR]   
        [COLOR= #FF8000]// Zelfde functie als bij registratie   
        // Een globale functies.php waarin je al je functies gooit is dus wel handig   [/COLOR]
        [COLOR= #007700]function[/COLOR] is_email[COLOR= #007700]([/COLOR][COLOR= #0000BB]$in[/COLOR][COLOR= #007700]) {[/COLOR]   
            [URL="http://www.php.net/list"]list[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$local[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$host[/COLOR][COLOR= #007700]) =[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]@[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$in[/COLOR][COLOR= #007700]);[/COLOR]   
            [COLOR= #0000BB]$pattern_local[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]^([0-9a-z]*([-|_]?[0-9a-z]+)*)(([-|_]?).[/COLOR]  
                           [COLOR= #007700].[/COLOR] [COLOR= #DD0000]([-|_]?)[0-9a-z]*([-|_]?[0-9a-z]+)+)*([-|_]?)$[/COLOR][COLOR= #007700];[/COLOR]   
            [COLOR= #0000BB]$pattern_host[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]^([0-9a-z]+([-]?[0-9a-z]+)*)(([-]?).([-]?)[/COLOR]  
                          [COLOR= #007700].[/COLOR] [COLOR= #DD0000][0-9a-z]*([-]?[0-9a-z]+)+)*.[a-z]{2,4}$[/COLOR][COLOR= #007700];[/COLOR]   
            [COLOR= #0000BB]$match_local[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/eregi"]eregi[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pattern_local[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$local[/COLOR][COLOR= #007700]);[/COLOR]   
            [COLOR= #0000BB]$match_host[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/eregi"]eregi[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pattern_host[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$host[/COLOR][COLOR= #007700]);[/COLOR]   
         
            [URL="http://www.php.net/return"]return[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$match_local[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$match_host[/COLOR] [COLOR= #007700]?[/COLOR] true [COLOR= #007700]:[/COLOR] false[COLOR= #007700]);   
        }[/COLOR]       
         
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR]is_email[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]])) {[/COLOR]   
            [COLOR= #0000BB]$fout[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Geen geldig e-mailadres![/COLOR][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 gebruikers SET   
                email = "[/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]email[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"   
                WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruiker[/COLOR][COLOR= #007700]]);[/COLOR]   
                [COLOR= #FF8000]// Vervolgens moet de pagina vernieuwd worden.   [/COLOR]
                [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Location: [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_URI[/COLOR][COLOR= #007700]]);   
        }   
    }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]   
        [COLOR= #FF8000]// Het formulier is nog niet verzonden, dus vullen we het veldje met het huidig e-mailadres   [/COLOR]
        [COLOR= #0000BB]$email[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT email FROM gebruikers WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruiker[/COLOR][COLOR= #007700]]),[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]);   
    }[/COLOR]   
?>   
<h1>Welkom, <?=htmlentities($_SESSION[gebruikersnaam])?>!</h1>   
Wijzig je e-mailadres:   
<?=$fout?>   
<form action="<?=htmlentities($_SERVER[REQUEST_URI])?>" method="post">   
<input type="text" name="email" value="<?=htmlentities($email)?>" />   
<input type="submit" value="Bijwerken" />  
</form>  
<a href="uitloggen.php" onclick="return confirm(Ben je zeker dat je je wilt afmelden?);">Uitloggen</a>
[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 ingelogged, klik <a href="login.php">hier</a> om dit te doen.[/COLOR][COLOR= #007700];   
}[/COLOR]   
?>
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
<h1>Welkom, <?= htmlentities($_SESSION[gebruikersnaam]); ?>!</h1>


?
0
Berichten
3.532
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/require"]require[/URL] [COLOR= #DD0000]connect.php[/COLOR][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]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruiker[/COLOR][COLOR= #007700]])) {[/COLOR]   
    [COLOR= #FF8000]// E-mailadres bijwerken:   
    // De variabele fout aanmaken om fouten ivm undefined variable te voorkomen   [/COLOR]
    [COLOR= #0000BB]$fout[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR]   
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700]) {[/COLOR]   
        [COLOR= #FF8000]// Zelfde functie als bij registratie   
        // Een globale functies.php waarin je al je functies gooit is dus wel handig   [/COLOR]
        [COLOR= #007700]function[/COLOR] is_email[COLOR= #007700]([/COLOR][COLOR= #0000BB]$in[/COLOR][COLOR= #007700]) {[/COLOR]   
            [URL="http://www.php.net/list"]list[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$local[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$host[/COLOR][COLOR= #007700]) =[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]@[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$in[/COLOR][COLOR= #007700]);[/COLOR]   
            [COLOR= #0000BB]$pattern_local[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]^([0-9a-z]*([-|_]?[0-9a-z]+)*)(([-|_]?).[/COLOR]  
                           [COLOR= #007700].[/COLOR] [COLOR= #DD0000]([-|_]?)[0-9a-z]*([-|_]?[0-9a-z]+)+)*([-|_]?)$[/COLOR][COLOR= #007700];[/COLOR]   
            [COLOR= #0000BB]$pattern_host[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]^([0-9a-z]+([-]?[0-9a-z]+)*)(([-]?).([-]?)[/COLOR]  
                          [COLOR= #007700].[/COLOR] [COLOR= #DD0000][0-9a-z]*([-]?[0-9a-z]+)+)*.[a-z]{2,4}$[/COLOR][COLOR= #007700];[/COLOR]   
            [COLOR= #0000BB]$match_local[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/eregi"]eregi[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pattern_local[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$local[/COLOR][COLOR= #007700]);[/COLOR]   
            [COLOR= #0000BB]$match_host[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/eregi"]eregi[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pattern_host[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$host[/COLOR][COLOR= #007700]);[/COLOR]   
         
            [URL="http://www.php.net/return"]return[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$match_local[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$match_host[/COLOR] [COLOR= #007700]?[/COLOR] true [COLOR= #007700]:[/COLOR] false[COLOR= #007700]);   
        }[/COLOR]       
         
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR]is_email[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]])) {[/COLOR]   
            [COLOR= #0000BB]$fout[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Geen geldig e-mailadres![/COLOR][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 gebruikers SET   
                email = "[/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]email[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]"   
                WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruiker[/COLOR][COLOR= #007700]]);[/COLOR]   
                [COLOR= #FF8000]// Vervolgens moet de pagina vernieuwd worden.   [/COLOR]
                [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Location: [/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_URI[/COLOR][COLOR= #007700]]);   
        }   
    }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]   
        [COLOR= #FF8000]// Het formulier is nog niet verzonden, dus vullen we het veldje met het huidig e-mailadres   [/COLOR]
        [COLOR= #0000BB]$email[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT email FROM gebruikers WHERE id = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruiker[/COLOR][COLOR= #007700]]),[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]);   
    }[/COLOR]   
?>   
<h1>Welkom, [COLOR= #0000BB]<?php[/COLOR] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]])[/COLOR] ?>!</h1>   
Wijzig je e-mailadres:   
<?=$fout?>   
<form action="[COLOR= #0000BB]<?php[/COLOR] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_URI[/COLOR][COLOR= #007700]])[/COLOR] ?>" method="post">   
<input type="text" name="email" value="<?=htmlentities($email)?>" />   
<input type="submit" value="Bijwerken" />  
</form>  
<a href="uitloggen.php" onclick="return confirm(Ben je zeker dat je je wilt afmelden?);">Uitloggen</a>
[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 ingelogged, klik <a href="login.php">hier</a> om dit te doen.[/COLOR][COLOR= #007700];   
}[/COLOR]   
?>


toevoeging op 12 februari 2012, 16:01:45:
Alstublieft
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