Loginscript

Gestart doorShahiem7 reacties48 weergaven

8 berichten · pagina 1 van 1

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hi,

Me loginscript doet het opeens niet confused Als ik op submit druk, doet hij niks. Hoe kan dat?

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/define"]define[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]TITEL[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]Inloggeen[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]includes/config.php[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]includes/header.php[/COLOR][COLOR= #007700];[/COLOR]

   [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]ingelogd [COLOR= #007700]==[/COLOR] false[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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
        {[/COLOR]
            
            [COLOR= #0000BB]$errorMelding[/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/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]) ===[/COLOR] [COLOR= #DD0000][/COLOR] [COLOR= #007700]||[/COLOR] [URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700]]) ===[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700])
            {[/COLOR]
                [COLOR= #0000BB]$errorMelding[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]Je hebt niet alle velden ingevuld.[/COLOR][COLOR= #007700];
            }[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
                    [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM leden WHERE naam = "[/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]naam[/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]$sql[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
            {[/COLOR]
            
                [COLOR= #0000BB]$errorMelding[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]Dit account bestaat niet.[/COLOR][COLOR= #007700];
            }[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
                [COLOR= #0000BB]$fetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR]
                 [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700]]) !=[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700]])  
                 {[/COLOR]
                
                    [COLOR= #0000BB]$errorMelding[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #DD0000]Het ingevoerde wachtwoord is incorrect.[/COLOR][COLOR= #007700];
                
                }
            }[/COLOR]
            
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$errorMelding[/COLOR][COLOR= #007700]))
            {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$errorMelding[/COLOR][COLOR= #007700];
            }[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
               [COLOR= #0000BB]$id[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$fetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR]
             [URL="http://www.php.net/setcookie"]setcookie[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700],[/COLOR][URL="http://www.php.net/time"]time[/URL][COLOR= #007700]()+[/COLOR][COLOR= #0000BB]60[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]60[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]24[/COLOR][COLOR= #007700]*[/COLOR][COLOR= #0000BB]30[/COLOR][COLOR= #007700]);[/COLOR]
             
             [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je bent ingelogd[/COLOR][COLOR= #007700];
                                
            }
        }
    }[/COLOR]
?>
<form action="" method="post">
    <table>
        <tr>
            <td width="350">Tovenaarsnaam:</td>
            <td><input class="text" type="text" name="naam" maxlength="20" /></td>
        </tr>
        <tr>
            <td>Wachtwoord:</td>
            <td><input class="text" type="password" name="wachtwoord" maxlength="50" /></td>
        </tr>
        <tr>
            <td><input type="submit" class="text" name="submit" value="- Inloggen! -" /></td>
            <td><input type="submit" class="text" name="send" value="- Opnieuw -" /></td>
                        <td>Nog geen account? | Wachtwoord vergeten?</td>

        </tr>
  </table>
 </form>
 
[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]<div class="error">Je bent al op Zweinstein.</div>[/COLOR][COLOR= #007700];
    }[/COLOR]
        
    [URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]includes/footer.php[/COLOR][COLOR= #007700];[/COLOR]
?>
0
Berichten
6.722
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je hebt wel vaak problemen met dat ledensysteem zeg! yummie
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Shahiem, kan je alsjeblieft één topic maken?
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Daar zal ik de volgende keer aandenken. (Hoop ik emo)
0
Berichten
1.168
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wordt er dan ook niks verstuurd, of word hij wel verstuurd?
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Er wordt niks verstuurd denk ik.

Shahiem, probeer het eens met een action in je form, dat je alles (behalve de form natuurlijk) in een ander bestand, en doe dan als action dat bestand.
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat hoeft niet per sé, Jos. Werkt ook heel omslachtig.
0
Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja, dat is wel waar.
Probeer bij action anders eens gewoon de naam van je pagina, dus als je pagina inloggen.php heet bij action ook inloggen.php invullen.
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