치명적 오류 : /mp3.is-great.org/htdocs/modules에없는 객체의 super_query() 멤버 함수를 호출하십시오.PHP - 치명적 오류 : 비 객체의 super_query() 멤버 함수 호출
<?php
if(isset($_REQUEST['username'])) $username = $_REQUEST['username'];
if(!$username) die("User not found!");
$user = $db->super_query("SELECT username, user_id, lastdate, reg_date, banned, info, foto, fullname, playlist, song FROM tan_users WHERE username = '$username'");
if(!$user) die("User not found!");
$row = $db->super_query("SELECT COUNT(*) AS count FROM tan_favorites WHERE user_id = '" . $user['user_id'] . "'");
$user['favorites'] = $row['count'];
$row = $db->super_query("SELECT COUNT(*) AS count FROM tan_playlists WHERE user_id = '" . $user['user_id'] . "'");
$user['playlists'] = $row['count'];
$smarty->assign("User", $user);
$action = $_REQUEST['action'];
$smarty->assign("Action", $action);
if($action == 'favorites'){
$db->query("SELECT source, hash, name FROM tan_favorites WHERE user_id = '" . $user['user_id'] . "'");
while ($row = $db->get_row($sql_result)){
$row['play_url'] = play_url($row['hash'], $row['source'], $row['name']);
$favorites[] = $row;
}
$smarty->assign('Favorites', $favorites);
}elseif($action == 'playlists'){
$db->query("SELECT tan_playlists.id, tan_playlists.foto, tan_playlists.name, tan_users.username, tan_users.fullname FROM tan_playlists LEFT JOIN tan_users ON tan_playlists.user_id = tan_users.user_id WHERE tan_playlists.user_id = '" . $user['user_id'] . "'");
while ($row = $db->get_row($sql_result)){
$playlists[] = $row;
}
$smarty->assign('Playlists', $playlists);
}else{
$db->query("SELECT source, hash, name FROM tan_favorites WHERE user_id = '" . $user['user_id'] . "' LIMIT 0,10");
while ($row = $db->get_row($sql_result)){
$row['play_url'] = play_url($row['hash'], $row['source'], $row['name']);
$favorites[] = $row;
}
$smarty->assign('Favorites', $favorites);
$db->query("SELECT tan_playlists.id, tan_playlists.foto, tan_playlists.name, tan_users.username, tan_users.fullname FROM tan_playlists LEFT JOIN tan_users ON tan_playlists.user_id = tan_users.user_id WHERE tan_playlists.user_id = '" . $user['user_id'] . "' ORDER by id DESC LIMIT 0,10");
while ($row = $db->get_row($sql_result)){
$playlists[] = $row;
}
$smarty->assign('Playlists', $playlists);
}
$smarty->assign("Title", $username);
if($member_id['username'] == $username) $smarty->assign("MEMBER", $member_id);
?>
어떤 아이디어가 왜이 오류가 될 것입니다 :
이 내 profile.php입니다 라인 7 /profile.php?
안전 모드 내 호스팅에 꺼져, 그것은 무료 호스트 그래서 내가 좀 PHP는 멍청한 놈, 내 문제를 해결하기 위해 어떤 도움과 링크를 감상 할 수있어
의 php.ini 변경할 수 있습니다.
귀하가 아닌 객체처럼 DB-연결이 변수'$의 db'입니다 초기화해야합니다. 당신은 수업을 시작하지 않습니다. 또한 쿼리에 변수를 삽입하여 ** hackable ** 및 ** insecure **로 만듭니다. 준비된 문과 함께 PDO를 사용하고 변수를 바인딩하십시오. – h2ooooooo
SQL 주입 공격을 피하기 위해 입력을 정리하고 있는지 확인하십시오. 이 작업을 수행하려면 mysqli_real_escape_string()을 사용하십시오. –