I try to connect to my database in the following way:
mysql_connect($server, $user, $pass);
mysql_select_db($db);
I know that mysql is obsolete but how I use an old version xampp should work. However, my page never ends up loading and is always waiting.
Start the session as follows:
<?php
@session_start();
if (isset($_POST['user']) && !empty($_POST['user']) && isset($_POST['pass']) && !empty($_POST['pass'])) {
include_once("includes/config.php");
if ($admin_user == $_POST['user']) {
if ($admin_password == sha1($_POST['pass'])) {
$_SESSION['login'] = true;
header("Location: stats.php");
exit();
}
}
}
?>
Could someone say how can I debug this code to get it started correctly?