Nesne olmayan mülkiyet elde etmek için çalışmak

0 Cevap

Bu senaryo harika çalışıyor. Ben komut üstüne bunu diyoruz. Yasak DEĞİLDİR Bir kullanıcı siteyi girerse Ama olsun:

Notice: Trying to get property of non-object in index.php on line 20

Fonksiyonu:

// Check if conecting user is banned. If ban has expired delete row.
function check_bans()
{

// IP address
$user_ip = $_SERVER['REMOTE_ADDR'];

$query = mysql_query("SELECT ip, expire FROM bans WHERE ip = '$user_ip'");
$row = mysql_fetch_object($query);

$expire = $row->expire ? date('M d Y H:i', $row->expire) : 'Never';

// Did we find a match?
if (mysql_num_rows($query)) {

    // Has this ban expired? Then delete and let user inside.
    if ($row->expire != '' && $row->expire <= time())
        mysql_query("DELETE FROM bans WHERE ip = '$user_ip'") or die (mysql_error());
    else
        die("<h1 align=\"center\" style=\"color:maroon\">You have been IP banished. Ban will be lifted: $expire</h1>");

}

}

0 Cevap