//get id from url //$make_name = $_GET['make']; $model_name = $_GET['model']; $error = ''; include ("includes/sanitizefxn.php"); // stripslashes(sanitize($make_name)); stripslashes(sanitize($model_name)); if (preg_match("/([%\$#\*\=.\\\\(\)\?]+)/", $model_name)) { $error .= 'This has a special character'; $model_name = ''; } //$model_id='1'; //$make='sharpp'; // connect to db include_once ("includes/connectdb.php"); //convert model_id to make and model $sql2="SELECT printer_model.model_id, printer_make.make_name, printer_model.model_name FROM `printer_model` JOIN printer_make ON printer_model.make_id=printer_make.make_id WHERE model_name='$model_name'"; //-------------- #$result2=mysql_query($sql2) or die(mysql_error()); $result2=mysqli_query($c,$sql2) or die(mysql_error()); //if (mysql_num_rows($result2) There was an issue.

"; } else { //while ($row2=mysql_fetch_array($result2)) { while ($row2=mysqli_fetch_array($result2)) { $model_id=$row2["model_id"]; $make=$row2["make_name"]; $model=$row2["model_name"]; } //add count views $sql="UPDATE printer_model SET printer_model.model_views = printer_model.model_views + 1 WHERE printer_model.model_id='$model_id'"; //$result=mysql_query($sql) or die(mysql_error()); $result=mysqli_query($c,$sql) or die(mysql_error()); //-------------- $makemodeltitle = "Default Password for ".$make . " " . $model; //echo $model_id." ".$make . " " . $model; } //--------------- //pull list of passwords $sql="SELECT printer_pass.pass_id, printer_pass.user_value, printer_pass.pass_value, printer_pass.vote_value FROM printer_pass WHERE printer_pass.model_id='$model_id' ORDER BY printer_pass.vote_value DESC"; //$result=mysql_query($sql) or die(mysql_error()); $result=mysqli_query($c,$sql) or die(mysql_error()); //if (mysql_num_rows($result) We do not have any listings for this device."; } else { //create the display string $display_block = " "; //while ($row=mysql_fetch_array($result)) { while ($row=mysqli_fetch_array($result)) { $user=$row["user_value"]; $pass=$row["pass_value"]; $vote=$row["vote_value"]; $display_block .= " "; } //close up the table $display_block .= "
UsernamePassword
$user$pass$vote
"; } ?> echo "$makemodeltitle";?>
include_once ("includes/header.inc.php"); ?>

echo $makemodeltitle;?>

echo $display_block; ?> include_once ("includes/footer.inc.php"); ?>