Hello!
I am trying to make a login system to will login to differnt pages depending on the subscription type
There are 3 different subscription types single, partner, family.
I made the $subtype varible because i couldnt figure out if it was even getting that data
So if i go Print $subtype it shows the data in there but i for some reason i cant get the nested elseif statment to work.. If someone could please show me what i am doing wrong i would greatly appreciate it.!! Thanks.
<?php
$db_host = 'localhost';
$db_user = '****';
$db_pass = '*****';
$db_db = '******';
$con = mysql_connect($db_host, $db_user, $db_pass) or die('MySQl Connection Error:'.mysql_error());
mysql_select_db($db_db, $con) or die('MySQL Error: Cannot select table');
$user = $_POST['login'];
$passwd = $_POST['password'];
$sql0 = "SELECT * FROM users";
$results = mysql_query($sql0,$con);
while($row = mysql_fetch_array($results))
if ($user == $row['login'] && $passwd == $row['password']) {
$subtype = $row['subtype'];
if ($subtype="atype") {
print "<META HTTP-EQUIV=\"refresh\" content=\"2; URL=/*****/a.php\">";
} elseif ($subtype="btype") {
print "<META HTTP-EQUIV=\"refresh\" content=\"2; URL=/******r/b.php\">";
}elseif ($subtype="ctype") {
print "<META HTTP-EQUIV=\"refresh\" content=\"2; URL=/******/c.php\">";
}else {
}
} else {
print "<META HTTP-EQUIV=\"refresh\" content=\"2; URL=/index.html\">";
}
mysql_close ($con);
?>