Hjælp! Hvorfor virker det ikke
Spørgsmål til genierne...Hvorfor kommer der bare en blank side her efter tryk på opret knappen:
<?php
$url = \'http://minside/accountok.php\';
$user = $_POST[\'username\'];
$pass = $_POST[\'password\'];
$pass2 = $_POST[\'password2\'];
$name = $_POST[\'name\'];
$address = $_POST[\'address\'];
$zip = $_POST[\'zip\'];
$city = $_POST[\'city\'];
$email = $_POST[\'email\'];
if (($pass)!=($pass2))
{
header("Location: error-pwverify.php");
Die();
}
function CheckMail($email)
{
if(eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\.[a-z]{2,4}$",$email))
{
return true;
}
else
{
return false;
}
}
if ((empty($email)) || (!CheckMail($email)))
{
header("Location: error-email.php");
Die();
}
function CheckZip($zip)
{
if (eregi("[0-9]", $zip))
{
return true;
}
else
{
return false;
}
}
if ((empty($zip)) || (!CheckZip($zip)) || (strlen($zip)!=4))
{
header("Location: error-zip.php");
Die();
}
if (empty($name))
{
header("Location: error-name.php");
Die();
}
if (empty($city))
{
header("Location: error-city.php");
Die();
}
if (empty($address))
{
header("Location: error-address.php");
Die();
}
$min_lenngth = 6;
if(strlen($user) < $min_lenngth || strlen($pass) < $min_lenngth)
{
header("Location: error-pwshort.php");
Die();
}
$conn = mysql_connect("localhost", "xxx", "xxxxx");
mysql_select_db("xxxxxxxxxxx", $conn) or die( "Unable to select database");
$check = mysql_query("select username from users where username=\"$user\"");
$returned = mysql_fetch_array($check);
if(!empty($returned))
{
header("Location: error-userexists.php");
mysql_close($connection);
Die();
}
else
{
where email=\"$email\"");
$returned = mysql_fetch_array($check);
if(!empty($returned))
{
header("Location: error-emailexists.php");
mysql_close($link);
Die();
}
else
$pass=md5($pass);
$request = "INSERT INTO users values(NULL,\'$name\',\'$user\',\'$pass\', \'$email\',\'$zip\',\'$city\',\'$address\')";
$results = mysql_query($request);
if($results)
{
header("Location: accountok.php");
}
else {
header("Location: error-account.php");
}
mysql_close($link);
Die();
}
echo <META HTTP-EQUIV=Refresh CONTENT="0; URL=.$url.">;
?>
