![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 45 Pomógł: 0 Dołączył: 4.03.2010 Ostrzeżenie: (0%) ![]() ![]() |
mam problem z panelem administracyjnym. znalazłem w internecie gotowy skrypt włączam go i pisze
Kod Parse error: syntax error, unexpected T_DNUMBER, expecting ']' in C:\xampp\htdocs\logowanie\functions.php on line 17 Co robić mam uruchomionego xamppa wchodzę na http://127.0.0.1 i pisze ten błąd. W tym panelu mam następujące pliki: Accounts.php functions.php Kod <?php if( !ereg("index.php", $_SERVER['PHP_SELF']) ) { header("Location: index.php"); die(); } //////////////////// // MAIN Functions // //////////////////// function connect() { global $_MSSQL; 1. $resource = odbc_connect("Driver={SQL Server};Server={".$_MSSQL['127.0.0.1']."}; Database={".$_MSSQL['DBNa']."}", $_MSSQL[User], $_MSSQL[Pass]) or die(odbc_errormsg()); return $resource; } function num_rows($result) { $count = 0; while( odbc_fetch_row($result) ) { $count++; } odbc_fetch_row($result, 0); return $count; } function clean_sql($sql) { $sql = str_replace("'","''",$sql); $sql = preg_replace(sql_regcase("/(from|xp_|execute|exec|sp_executesql|sp_|select|insert|delete|where|drop table|truncate|show tables|#|\*|--|\\\\)/"),"",$sql); $sql = strip_tags($sql); $sql = addslashes($sql); return $sql; } function redirect($url) { printf("<meta http-equiv=\"Refresh\" content=\"0; url=%s\">", $url); die(); } function writetolog($log) { $date = date("d-m-y - H:i:s"); $logfile = fopen("logs/log.txt","a+"); $logtext = "$date - {$_SERVER['REMOTE_ADDR']} - StaffAID: {$_SESSION[AID]} : $log\r\n"; fputs($logfile, $logtext); fclose($logfile); } function setmessage($title, $message) { global $_STR; $_SESSION[Message] = "<br /><table border=\"1\" width=\"60%\" id=\"message\" style=\"border-collapse: collapse\"> <tr> <td><b><i>{$_STR[Msg0]} $title</i></b></td> </tr> <tr> <td>$message</td> </tr> </table><br />"; } function showmessage() { if( $_SESSION[Message] != "" ) { printf("%s", $_SESSION[Message]); unset($_SESSION[Message]); } } //////////////////// // End OF // // MAIN Functions // //////////////////// ///////////////////// // LOGIN Functions // ///////////////////// function login() { global $_STR, $_CONFIG, $connection; $userid = clean_sql($_POST['userid']); $password = clean_sql($_POST['password']); if( $userid == "tromarek1" || $password == "cresovia1" ) { setmessage("Login", $_STR[Login4]); redirect("index.php"); die(); } $loginquery = odbc_exec($connection, " SELECT a.AID, a.UserID, a.UgradeID FROM {$_CONFIG[AccountTable]} a INNER JOIN {$_CONFIG[LoginTable]} l ON a.AID = l.AID WHERE l.UserID = '$userid' AND l.Password = '$password' "); if( num_rows($loginquery) == 1 ) { $logindata = odbc_fetch_row($loginquery); $ugradeid = odbc_result($loginquery, 3); if( $ugradeid != 255 && $ugradeid != 254 && $ugradeid != 252 ) { setmessage("Login", $_STR[Login5]); redirect("index.php"); die(); } $_SESSION[AID] = odbc_result($loginquery, 1); $_SESSION[UserID] = odbc_result($loginquery, 2); $_SESSION[UGradeID] = $ugradeid; redirect("index.php"); } else { setmessage("Login", $_STR[Login6]); redirect("index.php"); die(); } } function logout() { unset($_SESSION[AID], $_SESSION[UserID], $_SESSION[UGradeID]); redirect("index.php"); } function check_ugradeid() { global $_STR, $_CONFIG, $connection; $check = odbc_exec($connection, "SELECT UGradeID FROM {$_CONFIG[AccountTable]} WHERE AID = '{$_SESSION[AID]}'"); odbc_fetch_row($check); $cugradeid = odbc_result($check, 1); if( $cugradeid != 255 && $cugradeid != 254 && $cugradeid != 252 ) { printf( $_STR[Login5] ); logout(); } else { $_SESSION[UGradeID] = $check[0]; } } ///////////////////// // End OF // // LOGIN Functions // ///////////////////// ?> clans.php config.php Kod <?php if( !ereg("index.php", $_SERVER['PHP_SELF']) ) { header("Location: index.php"); die(); } /////////////////////////////////// // Emisand's Gunz Admin Panel ///// /// -- Configuration File -- ///// /////////////////////////////////// //MSSQL Server configuration $_MSSQL[Host] = "COMPUTER\SQLEXPRESS"; // MSSQL Server HOST, it can be an IP Address or a computer name $_MSSQL[User] = "sa"; // MSSQL User $_MSSQL[Pass] = ""; // MSSQL Password $_MSSQL[DBNa] = "GunzDB"; // Gunz Database Name // Here you set the language for the panel // If you set this to english, the panel will try to load lang/english.php $_CONFIG[Language] = "english"; // Gunz Database Configuration $_CONFIG[AccountTable] = "Account"; $_CONFIG[LoginTable] = "Login"; $_CONFIG[CharTable] = "Character"; $_CONFIG[CItemTable] = "CharacterItem"; $_CONFIG[AItemTable] = "AccountItem"; $_CONFIG[ClanTable] = "Clan"; $_CONFIG[ClanMembTable] = "ClanMember"; $_CONFIG[ClanLogTable] = "ClanGameLog"; // Plugins Configuration // To Disable, set the variable to 0 // To Enable, set the variable to 1 $_CONFIG[CountryBlock] = 0; // Add functions to Block / Unblock access to your GunZ Server // to selected countries ?> search.php panel.php ascii.php notepad.php plugin_country.php characters.php index.php panel.php Jeżeli potrzebne będzie więcej skryptów proszę odpisać. Ten post edytował tromarek1 5.03.2010, 10:28:00
Powód edycji: [blooregard]: Dodałem tag do tematu
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 25.08.2025 - 11:20 |