I have now reinstalled XAMPP and i got rid of most errors.
But i still have one error. This one :
Warning: mysql_connect(): Access denied for user 'admin'@'localhost' (using password: YES) in D:\xampp\htdocs\login_form\login.php on line 7
Could not connect to database.
SQL DATABASE :
login > users >
Id = 1
Username = admin
Password = admin
Id = 2
Username = login_system
Password = login_system
index.php :
<!DOCTYPE html>
<html>
<body>
<form action="login.php" method="POST">
<p>Username : </p><input type="text" name="user">
<p>Password : </p><input type="password" name="pass">
<br>
<input type="submit" value="Login">
</form>
</body>
</html>
login.php
<?php
//$ = variables?
$username = "admin";
$password = "admin";
$hostname ="localhost";
$database_handle = mysql_connect($hostname, $username, $password) or die ("Could not connect to database.");
$selected = mysql_select_db("login", $database_handle);
$myusername = $_POST['user'];
$mypassword = $_POST['pass'];
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
//Checks if the mySQL database matches the user inputs.
$query = "SELECT * FROM users WHERE Username='".$myusername."' and Password='".$mypassword."'";
$result = mysql_query($query,$database_handle);
$count = mysql_num_rows($result);
if ($count==1){
echo 'Databse connection and code was successful!';
}
?>
It said i needed to add more info which i couldn't.
Random text here..