Jump to content

coldfiretech

Members
  • Posts

    83
  • Joined

  • Last visited

    Never

Everything posted by coldfiretech

  1. I dont get it.... ??? Tried fixing the == Still nothing.. Can one of you please try this code out. I really think it is the if statement because the atype part of it works just not the b and c types ! 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); ?>
  2. I dont think that is the problem becuase i can read the field. I think my if statement is wrong because i can get into the a type page.....
  3. 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); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.