<?php
error_reporting(E_ALL);
include ("dbconnect.php");
if(isset($_POST['submit']))
{
//alles om te laten posten in de db
$username = addslashes($_POST['username']);
$password = md5($_POST['password']);
$hpassword = md5($_POST['hpassword']);
$showpassword = addslashes($_POST['password']);
$email = addslashes($_POST['email']);
$isAdmin = 0;
$secret_question = addslashes($_POST['secret_question']);
$ant = addslashes($_POST['ant']);
//Kijken of alle velden wel zijn ingevuld
if($password == "")
{
exit("Vul een password in");
}
if($hpassword == "")
{
exit("Herhaal je password");
}
if($username == "")
{
exit("Vul een username in");
}
if($email == "")
{
exit("Vul een email adres in");
}
if($password != $hpassword)
{
exit ("Vul hetzelfde wachtwoord in, anders kan je niet verder gaan");
}
$resultaat_username = mysql_query("SELECT `username` FROM $tbl_name WHERE `username` = '$username'");
if(mysql_num_rows($resultaat_username) > 0)
{
exit ("Deze username bestaat helaas al, vul een andere in.");
}
$aantal_email = mysql_query("SELECT `email` FROM $tbl_name WHERE email = '$email'");
if(mysql_num_rows($aantal_email) > 0)
{
exit ("Er is al een account aangemaakt op dit e-mail adres, log dus in met dat e-mail adres");
}
//in de db pompen
$insert = mysql_query("INSERT INTO $tbl_name (`username`, `password`, `email`, `active`, `isAdmin`, `secret_question`, `ant`) VALUES ('$username', '$password', '$email', '$isAdmin', '$secret_question', '$ant')") or die (mysql_error());
echo "Thanks For registering <br>
Ure username is : $username<br>
Ure password is : $showpassword<br>
Secret Question : $secret_question<br>
Your answer : $ant<br><br>
I urge u write down this information , because if u lose your password or its changed because some reasons u need this <br>
<br>
Thanks ,
<br>The Crew";
}
//wanneer er nix is ingevuld het formulier weergeven
if(!isset($_POST['submit']))
{
?>
<html>
<head>
<title>Aanmelden</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="register_action.php">
<p>Username
<input type="text" name="username">
<br>
Password
<input type="password" name="password">
<br>
Her password
<input type="password" name="hpassword">
<br>
Email
<input type="text" name="email">
<br>
<br>
Geheime vraag
<input type="text" name="secret_question">
<br>
Antwoord
<input type="text" name="ant">
<br>
<input type="submit" name="submit" value="Aanmelden">
</p>
</form>
<p> </p>
</body>
</html>
<?
}
?>ik krijg deze error als ik op de knop aanmelden klik
Column count doesn't match value count at row 1