login help!

when i submit nothing happens, please help! im a newbie in php :frowning:

[php]

Log in


















Username:
Password:
Classification:
Admin
Faculty
Student

</form>[/php]

validation.php
[php]
if (isset($_POST[‘submit’])) {
$username = $_POST[‘username’];
$password = $_POST[‘password’];
$selected_key = $_POST[‘class’];
$selected_val = $class[$_POST[‘class’]];

if ($selected_val=="student"){


$sql1 = mysql_query("SELECT * FROM student WHERE username='".$username."' AND password='".$password."' ");

if (mysql_num_rows($sql2) == 1 ) {
	$row = mysql_fetch_assoc($sql);
	header("Location: home.php");
	}
else{
	echo "Incorrect login details. Please try again";
	
	}}}[/php]

You need to name the submit button, right now, there is no $_POST[‘submit’].

Sponsor our Newsletter | Privacy Policy | Terms of Service