i try to alert, who want enter to member zone but not login and redirect them to index this is my session code and phpalert is my implement method using javascript then i test it javascript not display but it redirect to index.php
<?php
// Establishing Connection with Server by passing server_name, user_id and password as a parameter
$connection = mysql_connect("localhost", "root", "");
// Selecting Database
$db = mysql_select_db("project1", $connection);
session_start();// Starting Session
// Storing Session
$user_check=$_SESSION['login_user'];
// SQL Query To Fetch Complete Information Of User
$ses_sql=mysql_query("select user_id from users where user_id='$user_check'", $connection);
$user_std=mysql_query("select status from users where user_id='$user_check'",$connection);
$user_name=mysql_query("select name from users where user_id='$user_check'",$connection);
$row = mysql_fetch_assoc($ses_sql);
$row2 = mysql_fetch_assoc($user_std);
$row3 = mysql_fetch_assoc($user_name);
$login_session =$row['user_id'];
$name =$row3['name'];
$status=$row2['status'];
if(!isset($login_session)){
mysql_close($connection); // Closing Connection
header('Location: index2.php'); // Redirecting To Home Page
phpAlert("login before");
}
?>