I cant seem to get this login form to work right I have the login form come up and i can use it to get to the form.php page that i try to access but my problem is that its not verifying any login information, it just goes on through to the form page regardless. Let me give some more detail to clerify some things, im running this program over a local network so i dont need anything encrypted and also my login form is based entirely on an admin changable user name and password in phpmyadmin, my boss will have access to this page and be able to change the username and password to what he sees fit all i need to do is make sure that it reads the username and password from the database and checks to see if the entered ones are the same, if so then go to the form. here is the code i have, im sure its wrong but what i dotn understand is i have a similar function in another project that work exactly like it should with code set up like what i have here, also im getting this error that im sending the header before this is executed and it cant change the header again, which is weird cause i have commented out all the echos and so it shouldnt be giving me this error. Help please.
<html>
<form action="form.php" method="post">
<head>
<!-- Basics -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Login</title>
<!-- CSS -->
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/animate.css">
<link rel="stylesheet" href="css/styles.css">
</head>
<!-- Main HTML -->
<body>
<!-- Begin Page Content -->
<div id="container">
<form>
<label for="name">Username:</label>
<input type="name">
<label for="username">Password:</label>
<p><a href="#">Forgot your password?</a>
<input type="password">
<div id="lower">
<input type="checkbox"><label class="check" for="checkbox">Keep me logged in</label>
<input type="submit" value="Login" id="login">
</div>
</form>
</div>
<!-- End Page Content -->
<?php
//include("config.php");
//session_start();
$con = mysqli_connect("localhost", "root", "", "numbers") or die(mysqli_error($con));
if(isset($_GET['login']))
{
$myusername = $_GET['name'];
$mypassword = $_GET['password'];
}
//if($_SERVER["REQUEST_METHOD"] == "POST")
//{
// username and password sent from Form
$myusername=mysqli_real_escape_string($con,$_GET['name']);
$mypassword=mysqli_real_escape_string($con,$_GET['password']);
$sql="SELECT id FROM admin WHERE username='".$myusername."' AND password='".$mypassword."'";
$check= mysqli_query($con,$sql);
//$row= mysqli_fetch_array($result, MYSQLI_ASSOC);
//$active=$row['active'];
//$count= mysqli_num_rows($result);
$row = mysqli_fetch_row($check);
// If result matched $myusername and $mypassword, table row must be 1 row
if($row[0] == 0)
{
//session_register("myusername");
//session_register("mypassword");
//$_SESSION['login_user']=$myusername;
//echo "Successful Login";
header('location: form.php');
exit();
}
else
{
//$error="Your Login Name or Password is invalid";
//echo "$error";
header("location: login.php");
exit();
}
//}
?>
</body>
</form>
</html>