My code was properly working on school server but now I have changed the host and the page does not redirect. I have tried many things but none of them work. Thanks for your help!
My code:
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<?php require_once('baza.php'); ?>
<?php
session_start();
$user=$_POST['user'];
$pass=$_POST['pass'];
$encrypted_pass=md5($pass);
$sql="SELECT * FROM uporabniki WHERE uporabnik='$user' and geslo='$encrypted_pass'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1){
$_SESSION['user']=$user;
$_SESSION['pass']=$pass;
session_write_close();
header('Location: dostop.php');
}
else {
echo "Napačno uporabniško ime ali geslo.<br>";
echo "<a href='vpis.php'>Nazaj na vpis</a> ali ";
echo "<a href='index.php'>nazaj na Domačo stran.</a>";
}
?>
</html>