registratiesysteem

Gestart doorRaymon8 reacties130 weergaven

9 berichten · pagina 1 van 1

Raymon

Lid · Topicstarter

Berichten
37
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
hiya. ik ben bezig met een inlogsysteem voor mijn eerdere systeempje (waar overigens een slot op mag)
en nu werkt het verzenden naar de db niet.
script(denk dat het bij het connecten in de db zit:

<form action="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$PHP_SELF[/COLOR][COLOR= #007700])[/COLOR]?>" method="post">
<table>
<tr><th colspan="2">Registreren</th></tr>
<tr><td>gebruikersnaam</td><td><input type="text" name="username" size="15"></td></tr>
<tr><td>wachtwoord</td><td><input type="password" name="password" size="15"></td></tr>
<tr><td>wachtwoord <small>(controle)</small></td><td><input type="password" name="password2" size="15"></td></tr>
<tr><td></td><td><input type="submit" value="Registreer"></td></tr>
</table></form>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]config.php[/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= #0000BB]$username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$password[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$password2[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password2[/COLOR][COLOR= #007700]];[/COLOR]

    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$password[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]$password2[/COLOR][COLOR= #007700]){[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Wachtwoorden niet gelijk![/COLOR][COLOR= #007700];
    }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    
        [COLOR= #0000BB]$server[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]()[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"Er ging iets fout bij het verbinden met de database."[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$db[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$dbusername[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$dbpass[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"Er ging iets fout bij het selecteren van de database"[/COLOR][COLOR= #007700]);[/COLOR]
        
        [COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"INSERT INTO members (username, password) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700];[/COLOR]
        
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$server[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"Query niet kunnen uitvoeren"[/COLOR][COLOR= #007700]);[/COLOR]
        
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U bent geregistreerd.[/COLOR][COLOR= #007700];
    
    }
}[/COLOR]    
?>


hopelijk kan iemand hier een fout in vinden.

Mvg,
0
Berichten
2.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
je moet doen

mysql_connect($server, $user, $pass);
mysql_select_db($db);
0
Berichten
3.283
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
P.S het is ook misschien handig om te maken dat je wel een gebruikersnaam moet invullen als je nu niks bij gebruikersnaam invult kan je wel registreren.(geld ook bij wachtwoord)
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Eigg best wel handig ja. emo
0
Raymon

Lid · Topicstarter

Berichten
37
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
hi ruben(+ andere mede one2xs-forummers), thnx..

maar he..
hij doet t nog niet.
hier huidige script.:

<form action="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$PHP_SELF[/COLOR][COLOR= #007700])[/COLOR]?>" method="post">
<table>
<tr><th colspan="2">Registreren</th></tr>
<tr><td>gebruikersnaam</td><td><input type="text" name="username" size="15"></td></tr>
<tr><td>wachtwoord</td><td><input type="password" name="password" size="15"></td></tr>
<tr><td>wachtwoord <small>(controle)</small></td><td><input type="password" name="password2" size="15"></td></tr>
<tr><td></td><td><input type="submit" value="Registreer"></td></tr>
</table></form>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]config.php[/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= #0000BB]$username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$password[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$password2[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password2[/COLOR][COLOR= #007700]];[/COLOR]

    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$password[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]$password2[/COLOR][COLOR= #007700]){[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Wachtwoorden niet gelijk![/COLOR][COLOR= #007700];
    }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    
        [COLOR= #0000BB]$connectie[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$server[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$gebruiker[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$wachtwoord[/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_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$db[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$connectie[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"Kon de database niet selecteren"[/COLOR][COLOR= #007700]);[/COLOR]
        
        [COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"INSERT INTO members (username, password) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700];[/COLOR]
        
        [COLOR= #0000BB]$result[/COLOR][COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$connectie[/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/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]))
        {
        }[/COLOR]
        
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U bent geregistreerd.[/COLOR][COLOR= #007700];
    
    }
}[/COLOR]    
?>
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Waar is het form? Waar is je DB naam? Waar is je DB wachtwoord? ... emo
0
Raymon

Lid · Topicstarter

Berichten
37
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Appels:
Waar is het form? Waar is je DB naam? Waar is je DB wachtwoord? ... emo
jonge.. die staan in mijn config. en het form. die staat erbovenin?
0
Berichten
1
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
waarschijnlijk in de config.php he maat. Niet te snel wille reageren wink
Edit:
told ya
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Owj. FF verkeerd gekeken...
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