the db_connect file:
<?php
//connects to the database
$username = "username";
$password = "password";
$hostname = "host";
$database="database";
$link=mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL".mysql_error());
mysql_select_db($database, $link) or die("Could not select the database".mysql_error());
?>
the process-login file:
<?php session_start();
include "DB_connect.php";
if( !isset($_SESSION) )
$username=$_POST["UserName"];
$password=$_POST["Password"];
$errormessage = "";
$sql="SELECT * FROM members where UserName='$username' and Password='$password'";
$result = mysql_query($sql, $link) or exit('$sql failed: '.mysql_error());
$num_rows = mysql_num_rows($result);
if($num_rows==0){header("Location:login.php");}
else {
header("Location:MyPage.php");
exit;
}?>
could you help to identify the errors?