I'm trying to create a login page for my site. I's using php and mysql. The problem im facing is this:
The code below works on another server, but doesnt work on the server i'm creating the site. I'm running apache redhat linux 7.1.
The php connection to database worked sometime back on this server as well, but recently when i call the page craete_accounte.php the page just goes blank.
-----------create_account.html-------------
<head>
<title>login</title>
<body>
<form name="trylogin" method="post" action="validate.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:index.html");
exit;
}
$db_name = "login";
$table_name ="account";
$connection = @mysql_connect("localhost", "user1", "logpass") 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>