i have a probblem with this code:
does not show anything , only white in my broswer
and not getting an error message
___________________________________
<?php
session_start();
$con=mysql_connect("localhost", "root", "123456");
if(!$con)
{
die("Could not connect to database" . mysql_error());
}
else echo "Connection achieved". "<br/>";
?>
<html>
<head>
<title>Register</title>
</head>
<body background="sunglasses.jpg">
<?php
if (isset($_POST['submit']) && $_POST['submit'] == "Register")
{
if ($_POST['customer_username'] != "" && $_POST['customer_firstname'] != "" && $_POST['customer_lastname'] != "" && $_POST['customer_username'] != "" && $_POST['customer_password'] != "" && $_POST['customer_email'] != "")
{
$query=("SELECT customer_username FROM customer WHERE customer_username = '" . $_POST['customer_username'] . "'");
$result= mysql_query($query,$con) or die (mysql_error());
if (mysql_num_rows($result) != 0)
{
?>
<p>
<font face="comic sans ms"><b>The Username <?php echo $_POST['customer_username']; ?>, "</b></font>
<form color="#FF0000" action="register.php" method="post">
First Name: <input type="text" name="cutomer_firstname" value=" <?php echo $_POST['customer_firstname']; ?>" ><br>
Last Name: <input type="text" name="cutomer_lastname" value= "<?php echo $_POST['customer_lastname']; ?>" ><br>
User name: <input type="text" name="customer_username"><br>
Password: <input type="password" name="cutomer_password"><br>
E-mail: <input type="text" name="cutomer_email" value= "<?php echo $_POST['customer_email']; ?> "><br>
Address 1: <input type="text" name="cutomer_add1" value= "<?php echo $_POST['customer_add1']; ?> "><br>
Address 2: <input type="text" name="cutomer_add2" value= "<?php echo $_POST['customer_add2']; ?>"> <br>
City: <input type="text" name="cutomer_city" value= "<?php echo $_POST['customer_city']; ?> "><br>
Zip: <input type="text" name="cutomer_zip" value= "<?php echo $_POST['customer_zip']; ?>" ><br>
Phone: <input type="text" name="cutomer_phone" value= "<?php echo $_POST['customer_phone']; ?>" ><br><br>
<input type="submit" name="submit" value="Register">
<input type="reset" value="Clear">
</form></p>
<?php
}
else
{
$query = "INSERT INTO `customer` (`customer_firstname`, `customer_lastname`, `customer_username`, `customer_password`, `customer_email`, `customer_add1`, `customer_add2`, `customer_city`, `customer_zip`, `customer_phone`)
VALUES ('" . $_POST['customer_firstname'] . "','" . $_POST['customer_lastname'] . "','" . $_POST['customer_username'] . "','" . $_POST['customer_password'] . "','" . $_POST['customer_email'] . "','" . $_POST['customer_add1'] . "','" . $_POST['customer_add2'] . "','" . $_POST['customer_city'] . "','" . $_POST['customer_zip'] . "','" . $_POST['customer_phone'] . "')";
$result = mysql_query($query,$con) or die (mysql_error());
$_SESSION['user_logged'] = $_POST['customer_username'];
$_SESSION['user_password'] = $_POST['customer_password'];
?>
<p>
"Thank you <?php echo $_POST["customer_firstname"] ." " . $_POST["customer_lastname"];?>"</b> for registering!<br>";
<?php
//header("Refresh: 5; URL=intex.php");
echo "Your registration is complete!<br>";
echo " If your browser doesn’t support this, <a href="index.php">click here</a>)";
die();
}
}
else
{
?>
<font face="comic sans ms"><b>All fields are required!"</b></font>
<form color="#FF0000" action="register.php" method="post">
First Name: <input type="text" name="cutomer_firstname" value= "<?php echo $_POST['customer_firstname']; ?> "><br>
Last Name: <input type="text" name="cutomer_lastname" value= "<?php echo $_POST['customer_lastname']; ?> "><br>
User name: <input type="text" name="customer_username" value= "<?php echo $_POST['customer_username']; ?> "><br>
Password: <input type="password" name="cutomer_password" value="</php echo $_POST['customer_password'];>"><br>
E-mail: <input type="text" name="cutomer_email" value= "<?php echo $_POST['customer_email']; ?> "><br>
Address 1: <input type="text" name="cutomer_add1" value= "<?php echo $_POST['customer_add1']; ?>"><br>
Address 2: <input type="text" name="cutomer_add2" value= "<?php echo $_POST['customer_add2']; ?>" ><br>
City: <input type="text" name="cutomer_city" value= "<?php echo $_POST['customer_city']; ?> ><br>
Zip: <input type="text" name="cutomer_zip" value= "<?php echo $_POST['customer_zip']; ?>" ><br>
Phone: <input type="text" name="cutomer_phone" value= "<?php echo $_POST['customer_phone']; ?> "><br><br>
<input type="submit" name="submit" value="Register">
<input type="reset" value="Clear">
</form></p>
<?php
}
}
else
{
?>
<p>
Registration page!<br>
<b>All the fields required!</b>
<form color="#FF0000" action="register.php" method="post">
<b><font face="comic sans ms" color="#F7BDDE" > REGISTER </font></b>
<br>
Firstname <input type="text" size="20" name="customer_firstname">
<br>
Lastname <input type="text" size="20" name="customer_lastname">
<br>
User name <input type="text" size="20" name="customer_username">
<br>
Password <input type="text" size="20" name="customer_password">
<br>
E-mail <input type="text" size="20" name="customer_email">
<br>
Address 1 <input type="text" name="customer_add1">
<br>
Address 2 <input type="text" name="customer_add2">
<br>
City <input type="text" name="customer_city">
<br>
Zip <input type="text" name="customer_zip">
<br>
Phone <input type="text" name="customer_phone">
<br>
<input type="submit" name="submit" value="Register">
<input type="reset" value="Clear">
</form>
</p>
<?php
}
mysql_close($con);
?>
</body>
</html>