opret af bruger fejl ?
Dette er php koden der skulle modtage data fra html formen og burde være meget simpelt. Ved ikke hvad der er galt, men får min egen fejlmeddelseAn error occured <a href=\"java script:history.back(-1)\">Go back</a><
Nogen der lige kan spotte fejlen ?
$profiletype = $_POST["profiletype"];
$email = $_POST["email"];
$password = $_POST["password"];
$repeat = $_POST["repeat"];
$firstname = $_POST["firstname"];
$lastname = $_POST["lastname"];
$country = $_POST["country"];
$cityname = $_POST["cityname"];
$postalcode = $_POST["postalcode"];
$streetname = $_POST["streetname"];
$streetnumber = $_POST["streetnumber"];
$errorCount = "0";
$tjek = "SELECT email FROM users WHERE email = '". $_POST['email']."'";
$resultat = mysql_query($tjek);
if($profiletype == "")
{
echo "Please, choose your profiletype<br>";
$errorCount++;
}
if($email == "")
{
echo "Please, enter your email adress (your username)<br>";
$errorCount++;
}
if($password == "")
{
echo "Please, enter a password<br>";
$errorCount++;
}
if($repeat == "" || $repeat != $password)
{
echo "Your passwords don't match, please enter them carefully<br>";
$errorCount++;
}
if($firstname == "")
{
echo "Please, enter your first name<br>";
$errorCount++;
}
if($lastname == "")
{
echo "Please, enter your first name<br>";
$errorCount++;
}
if($country == "")
{
echo "Please, choose your country from the list<br>";
$errorCount++;
}
if($cityname == "")
{
echo "Enter your city's name<br>";
$errorCount++;
}
if($postalcode == "")
{
echo "Enter your postal code<br>";
$errorCount++;
}
if($streetname == "")
{
echo "Enter your street's name<br>";
$errorCount++;
}
if($streetnumber == "")
{
echo "Enter the number of your street where you live<br>";
$errorCount++;
}
if(mysql_num_rows($resultat) == 0)
{
if($errorCount == 0)
{
mysql_connect("******","******","******");
mysql_select_db("******");
$password = MD5($password);
$insert = mysql_query("INSERT INTO users (profiletype,email,password,firstname,lastname,country,cityname,postalcode,streetname,streetnumber,activationkey,status) VALUES ('$profiletype','$email','$password','$firstname','$lastname','$country','$cityname','$postalcode','$streetname','$streetnumber','$activationKey', 'verify')");
if(!$insert)
echo "An error occured <a href=\"java script:history.back(-1)\">Go back</a><br>";
else
echo "Your profile was created succesfully. <a href=\"index.php\">Login</a><br>";
}
}
else
{
echo "brugernavnet er optaget!";
}