Im trying to create a login facility in my site using php and mysql. The problem im facing with the script is that when i try to create an account or authenticate one, The php file that authentiucates, produces a blank page. I tried the script in another server and it works well. I guess there is some config problem. Can anyone help me out?
The code
-------------------------create_account.html---------------------------
<head>
<title>login</title>
<body>
<form name="trylogin" method="post" action="create_account.php">
User id:
<input type= text name="username"><br>
Password:
<input type="password" name ="passwd"><br>
<input type="submit" name="enterpass" value"Submit">
</form>
</body>
-------------------------create_account.php----------------------------
<?
if((!$username) || (!$passwd)) {
header ("Location:create_account.html");
exit;
}
$db_name = "logindb";
$table_name ="account";
$connection = @mysql_connect("localhost", "user1", "mysqlpass") or die("Couldn't connect.");
$db = mysql_select_db($db_name, $connection) or die("couldn't select database");
$sql = "Insert INTO $table_name (user, pass) VALUES ( \"$username\",\"$passwd\")";
$result= @($sql,$connection) or die("couldn't execute query");
?>
<head>
<title>
</title>
</head>
<body>
added users</body>