Hello,
I just had to reinstall windows and everything i had on my computer. Before i had a working PHP, Apache and mysql system and now i've reinstalled all of it. When I test my website again the login script isn't working.
If i enter wrong username and password i get redirected to index.php and thats good, but when i enter the right username and password Internet Explorer says it can't find some page and the page that it's supposed to find is admin.php, but the code isn't wrong because it worked before.
the login.php:
<?php
include("../inc/connect.php");
if (isset($user) && isset($pass)) {
$query = "SELECT id, username FROM mc_users WHERE username='$user' AND password=PASSWORD('$pass')";
$res = mysql_query($query) or die ("Kan inte läsa från databasen!");
$row = mysql_fetch_array($res);
if (isset($row['id'])) {
session_start();
$uid = $row['id'];
$uname = $row['username'];
session_register("uid", "uname");
// Om allt går rätt skickas man till administrations sidorna.
Header("Location: admin.php");
}
else {
Header("Location: ../index.php");
}
}
else {
Header("Location: ../index.php");
}
?>
the admin.php is in the same folder as the login.php and the index.php is in one folder lower.
I wounder if it can be that i installed apache 2 now and before i had 1.something.?
Thanks for help!