humbleprogrammer
Programmer
Hello,
I am probably missing something obvious but can someone please help me trouble shoot this code. I am trying to pass the office value stored in the table in the querystring but it's not working. Thanks in advance!
I am probably missing something obvious but can someone please help me trouble shoot this code. I am trying to pass the office value stored in the table in the querystring but it's not working. Thanks in advance!
Code:
<?php
include("Connection.php");
$strQuery = "SELECT * FROM tblUsers WHERE username = '".$frmUsername."' AND password = '".$frmPassword."'";
$row = mysql_query($strQuery) or die("Error".mysql_error());
$office=$row['office'];
if(mysql_num_rows($row)) {
print("<br><br><b>Welcome, $frmUsername!<br><br><a href=dateselection.php?username=$frmUsername&office=$office>CLICK HERE</a> to view the reports for your office");
}
else {
print("<br><br><b>Sorry, this login is invalid!</b><br><br>Please <a href='login.php'>GO BACK</a> and try again.");
exit;
}
?>