Hallo,
Ik ben een beetje bezig met PHP en mijn login alles werkt (als ik gebruikers via DB invul ^^)
Maar nu ben ik met registreer pagina bezig. Hij zegt wel: Je account is geregistreerd maar hij staat niet in DB)
Voor de goede oplossing krijg die persoon 0,01
Alvast Bedankt!
Ik ben een beetje bezig met PHP en mijn login alles werkt (als ik gebruikers via DB invul ^^)
Maar nu ben ik met registreer pagina bezig. Hij zegt wel: Je account is geregistreerd maar hij staat niet in DB)
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<h1>Registeren</h1>"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$submit[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$helenaam[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]helenaam[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$username[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$password[/COLOR][COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$repeatpassword[/COLOR][COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR] [COLOR= #007700][[/COLOR][COLOR= #DD0000]repeatpassword[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$date[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Y-d-m"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$submit[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #FF8000]//check for dingen.[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$helenaam[/COLOR][COLOR= #007700]&&[/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700]&&[/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700]&&[/COLOR][COLOR= #0000BB]$repeatpassword[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #0000BB]$repeatpassword[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700])>[/COLOR][COLOR= #0000BB]25[/COLOR][COLOR= #007700]||[/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$helenaam[/COLOR][COLOR= #007700])>[/COLOR][COLOR= #0000BB]25[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Lenge gebruikers naam of helenaam is te kocht<br>"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700])>[/COLOR][COLOR= #0000BB]25[/COLOR][COLOR= #007700]||[/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700])<[/COLOR][COLOR= #0000BB]6[/COLOR][COLOR= #007700])
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Passwoord is te lelang!<br>"[/COLOR][COLOR= #007700];
}
{[/COLOR]
[COLOR= #FF8000]//rehisteer de gebruiker
// md5 van maken![/COLOR]
[COLOR= #0000BB]$password[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$repeatpassword[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$repeatpassword[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$connect[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"root"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"nietzichtbaarsorry"[/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= #DD0000]"phplogin"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$qlquery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"INSERT INTO users VALUES($helenaam,$username,$password,$date)"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je bent geregisteerd! <a href=index.php>Klik hier</a> om inteloggen!"[/COLOR][COLOR= #007700];
}
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"paswoord is niet goed<br>"[/COLOR][COLOR= #007700]);
{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Je Gebruikersnaam/helenaam is te lang of te kort!!"[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Vul wel alles in!"[/COLOR][COLOR= #007700];
}[/COLOR]
?>
<html>
<form action="registeren.php" method="POST">
<table>
<tr>
<td>
Jouw helenaam
</td>
<td>
<input type="text" name="helenaam" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$helenaam[/COLOR][COLOR= #007700];[/COLOR] ?>">
</td>
</tr>
<tr>
<td>
Je gebruikersnaam:
</td>
<td>
<input type="text" name="username" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$username[/COLOR][COLOR= #007700];[/COLOR] ?>">
</td>
</tr>
<tr>
<td>
Wachtwoord
</td>
<td>
<input type="password" name="password" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$password[/COLOR][COLOR= #007700];[/COLOR] ?>">
</td>
</tr>
<tr>
<td>
Herhaal je wachtwoord
</td>
<td>
<input type="password" name="repeatpassword" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$repeatpassword[/COLOR][COLOR= #007700];[/COLOR] ?>">
</tr>
</table>
<p>
<input type="submit" name="submit" value="Registeren!">
<input type="reset" name="rest" value="Leegmaken">
</form>
</html> Voor de goede oplossing krijg die persoon 0,01

Alvast Bedankt!

