I need help for my code when i login successfly i have error this is my code:
<?php
session_start();
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="portfolio_baza"; // Database name
$tbl_name="skole_login"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// username and password sent from form
$email=$_POST['email'];
$login_pass=$_POST['login_pass'];
// To protect MySQL injection (more detail about MySQL injection)
$email = stripslashes($email);
$login_pass = stripslashes($login_pass);
$email = mysql_real_escape_string($email);
$login_pass = mysql_real_escape_string($login_pass);
$sql="SELECT * FROM $tbl_name WHERE email='$email' and login_pass='$login_pass'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1){
session_register("email");
session_register("login_pass");
header("location:login_success.php");
}
else {
echo "Wrong Username or Password";
}
?>
error in this page login_success.php"
<?php
session_start();
if(!session_register(email)){ // error on line 3
header("location: adminskola.php");
}
?>
Login Successful