ok ive been trying for a while to put together
$sql = mysql_query("SELECT * FROM login WHERE activated='yes'");
$login_check = mysql_num_rows($sql);
else if($login_check !== 0) {
$_SESSION["userid_log"]=$row["userid"];
header ("Location: index.php");
}
else
{
header ("Location: index.php?login=activate");
}
and
<?php
session_start();
$name=session_name();
$log_userid=$_SESSION["userid_log"];
if (!isset ($_SESSION["userid_log"]))
{
header ("Location:index.php?login=missing");
}
include("config.php");
mysql_connect($dbhost,$dbuser,$dbpass) or die("Connect to database is faild");
@mysql_select_db( "$dbname") or die( "There is no database like $dbname");
if($log){
$sqllog=mysql_query(" SELECT * FROM login WHERE username='$loginname' AND passwd='$pass'");
if($sqllog){
$row=mysql_fetch_array($sqllog);
}
$num=mysql_num_rows($sqllog);
if($num==1){
$_SESSION["userid_log"]=$row["userid"];
header ("Location: index.php");
}
else
{
header ("Location: index.php?login=wrong");
}
}
?>
so that if the DB sees that the username is not activated it wont connect and itll go to "Location: index.php?login=activate" i just need help putting the top and bottom one together so that once it checks that the pass and the username are right it checks to see if the account is activated