Hallo, ich kenn mich noch nicht so gut aus mit PHP und wollte mir ein banner Exchange Script installieren, alles klappt nur die Anzeige der banner nicht.
Es kommt immmer die Fehlermeldung:
Warning: shuffle() expects parameter 1 to be array, null given in ...../getbanner.inc on line 13
Warning: shuffle() expects parameter 1 to be array, null given in ...../getbanner.inc on line 15
Datei Getbanner.inc:
Es kommt immmer die Fehlermeldung:
Warning: shuffle() expects parameter 1 to be array, null given in ...../getbanner.inc on line 13
Warning: shuffle() expects parameter 1 to be array, null given in ...../getbanner.inc on line 15
Datei Getbanner.inc:
PHP-Code:
<?
$result_get_user_info = mysql_query("SELECT * FROM users WHERE id='$uid'");
$user_info = mysql_fetch_array($result_get_user_info);
$result_get_banner = mysql_query("SELECT user_login FROM users WHERE imp_left > 0 AND act='1' AND numban > 0");
while ($banner = mysql_fetch_array($result_get_banner)){
$bid[] = "$banner[user_login]";
}
$ip = getenv ("REMOTE_ADDR");
srand ((float)microtime()*1000000);
shuffle ($bid);
srand ((float)microtime()*1000000);
shuffle ($bid);
$id = "$bid[0]";
$id2 = "$bid[1]";
$checkban = "$banner[lastbannerid]";
If ($id == "$checkban"){
$id = "$bid[1]";
}
ElseIf ($id == ""){
$id = "$bid[1]";
}
ElseIf ($id != "$checkban" || $id != ""){}
mysql_pconnect("$dbhost", "$dbuser", "$dbpass")
or die ("Unable to connect to database.");
mysql_select_db("$dbname")
or die ("Unable to select database.");
If ($id != "$user_info[user_login]"){
$result_get_banner_info = mysql_query("SELECT * FROM banners WHERE user='$id'");
$banner_info = mysql_fetch_array($result_get_banner_info);
}
If ($id == "$user_info[user_login]"){
mysql_pconnect("$dbhost", "$dbuser", "$dbpass")
or die ("Unable to connect to database.");
mysql_select_db("$dbname")
or die ("Unable to select database.");
$result_get_banner_info = mysql_query("SELECT * FROM banners WHERE user='$id2'");
$banner_info = mysql_fetch_array($result_get_banner_info);
}
?>
Kommentar