i having problem and stucked with retrieving like lastnametname. and i am stucked with how do i check if admin=1 will redirect to admin.php if admin=0 will redirect to welcome.php instead.
this is the part of my login process script
$q = "SELECT * FROM members2 WHERE (email='$e' AND password='$p')";
$q2 = "SELECT admin FROM members2 WHERE (admin='1')";
$r = mysqli_query ($dbc, $q);
if (mysqli_num_rows($r) == 1) { // A match was made.
// Get the data:
//header('Location: welcome.php');
$welcomepage = "welcome.php";
echo '<script language="javascript" type="text/javascript">window.location.href="'.$welcomepage.'";</script>';
$row = mysqli_fetch_array ($r, MYSQLI_NUM);
$lastname = $row['lastname'];
$_SESSION['lastname'] = $lastname;
$_SESSION['email'] = $_POST['email'];
}