Can someone plz help me 🙂
Get these errors in IE, chrome and not in ff and whatever i do it dont work :/
Notice: Undefined variable: quer3 in C:\wamp\www\NSE-Klient\my-team.php on line 192
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given in C:\wamp\www\NSE-Klient\my-team.php on line 192
<?php
require_once 'config.php';
require_once 'auth.php';
?>
<?php
$team_connect = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if (!$team_connect) {
die("Failed to connect to server" . mysql_error());
}
$db_team = mysql_select_db(DB_DATABASE);
if (!$db_team) {
die("Could not fetch database");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Login Form</title>
<link href="loginmodule.css" rel="stylesheet" type="text/css" />
<script language=JavaScript>
function reload(form){
var val=form.cat.options[form.cat.options.selectedIndex].value;
self.location='my-team.php?cat=' + val ;
}
function reload2(form){
var val=form.cat.options[form.cat.options.selectedIndex].value;
var val2=form.subcat.options[form.subcat.options.selectedIndex].value;
self.location='my-team.php?cat=' + val + '&cat2=' + val2 ;
}
function reload3(form){
var val=form.cat.options[form.cat.options.selectedIndex].value;
var val2=form.subcat.options[form.subcat.options.selectedIndex].value;
var val3=form.subsubcat.options[form.subsubcat.options.selectedIndex].value;
self.location='my-team.php?cat=' + val + '&cat2=' + val2 + '&cat3=' +val3;
}
function reload4(form){
var val=form.cat.options[form.cat.options.selectedIndex].value;
var val2=form.subcat.options[form.subcat.options.selectedIndex].value;
var val3=form.subsubcat.options[form.subsubcat.options.selectedIndex].value;
var val4=form.subsubsubcat.options[form.subsubsubcat.options.selectedIndex].value;
self.location='my-team.php?cat=' + val + '&cat2=' + val2 + '&cat3=' + val3 + '&cat4=' + val4;
}
function reload5(form){
var val=form.cat.options[form.cat.options.selectedIndex].value;
var val2=form.subcat.options[form.subcat.options.selectedIndex].value;
var val3=form.subsubcat.options[form.subsubcat.options.selectedIndex].value;
var val4=form.subsubsubcat.options[form.subsubsubcat.options.selectedIndex].value;
var val5=form.subsubsubsubcat.options[form.subsubsubsubcat.options.selectedIndex].value;
self.location='my-team.php?cat=' + val + '&cat2=' + val2 + '&cat3=' + val3 + '&cat4=' + val4 + '&cat5=' + val5;
}
</script>
</head>
<body>
<div id="main">
<h1>My Team</h1>
<a href="member-profile.php">My Profile</a> | <a href="sale-page.php">Sale</a> | <a href="team-page.php">Team</a> | <a href="logout.php">Logout</a>
<br />
<br />
<?php
if (isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR']) > 0) {
echo '<ul class="err">';
foreach ($_SESSION['ERRMSG_ARR'] as $msg) {
echo '<li>', $msg, '</li>';
}
echo '</ul>';
unset($_SESSION['ERRMSG_ARR']);
}
?>
<?php
$cat = @$_GET['cat'];
if (strlen($cat) > 0 and !is_numeric($cat)) {
echo "Data Error";
exit;
}
$cat2 = @$_GET['cat2'];
if (strlen($cat2) > 0 and !is_numeric($cat2)) {
echo "Data Error";
exit;
}
$cat3 = @$_GET['cat3'];
if (strlen($cat3) > 0 and !is_numeric($cat3)) {
echo "Data Error";
exit;
}
$cat4 = @$_GET['cat4'];
if (strlen($cat4) > 0 and !is_numeric($cat4)) {
echo "Data Error";
exit;
}
$cat5 = @$_GET['cat5'];
if (strlen($cat5) > 0 and !is_numeric($cat5)) {
echo "Data Error";
exit;
}
$start = $_SESSION['SESS_MEMBER_ID'];
$quer1 = mysql_query("SELECT firstname, lastname, member_id FROM members where sponsor=$start");
if (isset($cat) and strlen($cat) > 0) {
$quer2 = mysql_query("SELECT firstname, lastname, member_id FROM members where sponsor=$cat");
} else {
$quer2;
}
if (isset($cat2) and strlen($cat2) > 0) {
$quer3 = mysql_query("SELECT firstname, lastname, member_id FROM members where sponsor=$cat2");
} else {
$quer3;
}
if (isset($cat3) and strlen($cat3) > 0) {
$quer4 = mysql_query("SELECT firstname, lastname, member_id FROM members where sponsor=$cat3");
} else {
$quer4;
}
if (isset($cat4) and strlen($cat4) > 0) {
$quer5 = mysql_query("SELECT firstname, lastname, member_id FROM members where sponsor=$cat4");
} else{
$quer5;
}
echo "<form method=post name=f1 action='dd-check.php'>";
echo "<select name='cat' size=10 onchange=\"reload(this.form)\">";
while ($noticia = mysql_fetch_assoc($quer1)) {
if ($noticia['member_id'] == @$cat) {
echo "<option selected value='$noticia[member_id]'>$noticia[firstname] $noticia[lastname] <br \></option>" . "<BR>";
} else {
echo "<option value='$noticia[member_id]'>$noticia[firstname] $noticia[lastname]</option>";
}
}
echo "</select>";
echo "<select name='subcat' size=10 onchange=\"reload2(this.form)\">";
while ($noticia = mysql_fetch_assoc($quer2)) {
if ($noticia['member_id'] == @$cat2) {
echo "<option selected value='$noticia[member_id]'>$noticia[firstname] $noticia[lastname]</option>" . "<BR>";
} else {
echo "<option value='$noticia[member_id]'>$noticia[firstname] $noticia[lastname]</option>";
}
}
echo "<select name='subsubcat' size=10 onchange=\"reload3(this.form)\">";
while ($noticia = mysql_fetch_assoc($quer3)) {
if ($noticia['member_id'] == @$cat3) {
echo "<option selected value='$noticia[member_id]'>$noticia[firstname] $noticia[lastname]</option>" . "<BR>";
} else {
echo "<option value='$noticia[member_id]'>$noticia[firstname] $noticia[lastname]</option>";
}
}
echo "<select name='subsubsubcat' size=10 onchange=\"reload4(this.form)\">";
while ($noticia = mysql_fetch_assoc($quer4)) {
if ($noticia['member_id'] == @$cat4) {
echo "<option selected value='$noticia[member_id]'>$noticia[firstname] $noticia[lastname]</option>" . "<BR>";
} else {
echo "<option value='$noticia[member_id]'>$noticia[firstname] $noticia[lastname]</option>";
}
}
echo "<select name='subsubsubsubcat' size='10' width='100' onchange=\"reload5(this.form)\">";
while ($noticia = mysql_query(@$quer5)) {
if ($noticia['member_id'] == @$cat5) {
echo "<option selected value='$noticia[member_id]'>$noticia[firstname] $noticia[lastname]</option>" . "<BR>";
} else {
echo "<option value='$noticia[member_id]'>$noticia[firstname] $noticia[lastname]</option>";
}
}
echo "</select>";
?>
<br />
<br />
<h1></h1><i>Password Protected Area </i></div>
</body>
</html>