Io non riesco a capire dov'è che sbaglio, potete dare voi un'occhiata?
codice:
<?php
$userType = $_POST['user'];
if ($userType == "private")
{
$enable = "n";
$password = $_POST['password'];
$password2 = $_POST['password2'];
$firstlastname = $_POST['firstlastname'];
$address = $_POST['address'];
$cap = $_POST['cap'];
$local = $_POST['local'];
$city = $_POST['city'];
$email = $_POST['email'];
$telephone = $_POST['telephone'];
$mobile = $_POST['mobile'];
$link = "http://localhost/dieffegioielli/registration.php?userType=" + $userType;
if ($password == "")
{
$err = "\'Password\' è un campo obbligatorio";
header ("Location: errorPage.php?err=$err&link=$link");
}
if ($password2 == "")
{
$err = "'Ripetere password' è un campo obbligatorio";
header ("Location: errorPage.php?err=$err&link=$link");
}
if ($password != $password2)
{
$err = "I due campi delle password non coincidono";
header ("Location: errorPage.php?err=$err&link=$link");
}
if ($firstlastname == "")
{
$err = "'Nome e cognome' è un campo obbligatorio";
header ("Location: errorPage.php?err=$err&link=$link");
}
if ($telephone == "")
{
$err = "'Telefono' è un campo obbligatorio";
header ("Location: errorPage.php?err=$err&link=$link");
}
include ("db_connect.php");
mysql_query ("INSERT INTO private_user_table (enable, password, firstlastname, address, cap, local, city, email, telephone, mobile) VALUES ('$enable', '$password', '$firstlastname', '$address', '$cap', '$local', '$city', '$email', '$telephone', '$mobile')", $db)
or die ("Spiacente, si è verificato un errore interno. <a href = \"http://localhost/dieffegioielli/registration.php?userType=" + $userType
+ "\">Torni indietro</a> e riprovi.");
header ("Location: http://localhost/dieffegioielli/successRegistration.php");
}
else if ($userType == "seller")
{
}
?>