Autor Zpráva
Jarunka14
Profil *
Po přechodu na novej webhosting se mi přestaly zobrazovat místnosti v administraci. Je zde nějaká zastaralá funkce? Děkuji

<? require('gen_inc.php'); if($valid == false) die(); ?>

      var gameslist = '<';
gameslist += 'table border="0" cellspacing="0" cellpadding="3" width="100%" class="smllfontwhite">';


<? $tableq = mysql_query("select gameID, p1name, p2name,p3name,p4name,p5name, p6name,p7name,p8name,p9name,p10name, p1pot, p2pot, p3pot, p4pot, p5pot, p6pot, p7pot, p8pot, p9pot, p10pot, tablename,tablelimit ,tabletype,hand,tablelow, pot from ".DB_POKER." order by tablelimit asc "); while($tabler = mysql_fetch_array($tableq)){ $i = 1; $x=0; $time = time(); $ktimer = DISCONNECT; $timekick = $time-$ktimer; $gamID = $tabler['gameID']; while($i < 11){ if(strlen($tabler['p'.$i.'name']) != ''){ $usr = $tabler['p'.$i.'name']; $pot = $tabler['p'.$i.'pot']; $ttq = mysql_query("select gID, timetag from ".DB_PLAYERS." where username = '".$usr."'  "); $ttr = mysql_fetch_array($ttq); if(($ttr['timetag'] < $timekick) || ($ttr['gID'] != $gamID)){ $result = mysql_query("update ".DB_POKER." set p".$i."name = '', p".$i."bet = '', p".$i."pot = '' , lastmove = '".($time+1)."' where gameID = '".$gamID."' "); $result = mysql_query("update ".DB_STATS." set winpot = winpot + ".$pot." where player  = '".$usr."'  "); $result = mysql_query("update ".DB_PLAYERS." set gID = '' where username = '".$usr."' "); } $x++; } $i++; } $tablename = $tabler['tablename']; $min = money_small($tabler['tablelow']); $tablelimit = $tabler['tablelimit']; $max = money_small($tablelimit); $gID = $tabler['gameID']; $tablemultiplier = 1; if($tablelimit == 25000) $tablemultiplier = 2; if($tablelimit == 50000) $tablemultiplier = 4; if($tablelimit == 100000) $tablemultiplier = 8; if($tablelimit == 250000) $tablemultiplier = 20; if($tablelimit == 500000) $tablemultiplier = 40; if($tablelimit == 1000000) $tablemultiplier = 80; if($tabler['tabletype'] == 't'){ $BB = money_small(50*$tablemultiplier).'-'.money_small(50*$tablemultiplier*9); $SB = money_small(25*$tablemultiplier).'-'.money_small(25*$tablemultiplier*9); }else{ $BB = money_small(200*$tablemultiplier); $SB = money_small(100*$tablemultiplier); } $tableplayers = $x.'/10'; $NEW_GAME = addslashes(NEW_GAME); $PLAYING = addslashes(PLAYING); $tablestatus = (($tabler['hand'] == '')? $NEW_GAME : $PLAYING); $TOURNAMENT = addslashes(TOURNAMENT); $SITNGO = addslashes(SITNGO); $tabletype = (($tabler['tabletype'] == 't')? $TOURNAMENT : $SITNGO); $buyin = (($tabler['tabletype'] == 't')? $max : $min.'/'.$max); ?>
        gameslist += '<tr onMouseOver="this.bgColor = \'#330000\'; this.style.color = \'#FFFFFF\';" onMouseOut="this.bgColor = \'\'; this.style.color = \'#FFFFFF\';"  onClick="selectgame(\'lobby.php?gameID=<? echo $gID; ?>\');" class="hand">'; 

          gameslist += '<td class="smllfontwhite" width="120"><? echo $tablename; ?></td><td width="50" align="center" class="smllfontwhite"><? echo $tableplayers; ?></td><td class="smllfontwhite" width="80" align="center"><? echo $tabletype; ?></td><td class="smllfontwhite" width="90" align="center"><? echo $buyin; ?></td><td class="smllfontwhite" width="90" align="center"><? echo $SB; ?></td><td class="smllfontwhite" width="90" align="center"><? echo $BB; ?></td><td class="smllfontwhite" width="80" align="center"><? echo $tablestatus; ?></td></tr>';
        <? } ?>
      gameslist += '</table>';
document.getElementById('gamelist').innerHTML = gameslist;



<div id="gamelist" style="border : solid 0px   padding : 1px; width : 100%; height : 365px; overflow : auto; ">
 </div ><br><?
$tableq = mysql_query("select p1name, p2name,p3name,p4name,p5name,p6name,p7name,p8name,p9name,p10name,tablename,tablelimit,tabletype,hand,tablelow from ".DB_POKER." order by tablelimit asc ");
while($tabler = mysql_fetch_array($tableq)){ 
$i = 1;
$x=0;
while($i < 11){
if($tabler['p'.$i.'name'] != '') $x++;
$i++;
}
$tableplayers = $x.'/10';
$tablestatus = (($tabler['hand'] == '')? 'New Game' : 'Playing');
$tabletype = (($tabler['tabletype'] == 't')? 'Tournament' : 'Sit \'n Go');
?>
        <? } ?>
jenikkozak
Profil
Nejčastější potíže s PHP (FAQ) » Nefungují proměnné z formuláře nebo z URL (vypnuté register globals)
Jarunka14
Profil *
Děkuji za odpověď, ale moc tomu nerozumím. Nemohl by jste mi prosím aspoň naznačit co mám změnit? Děkuji mnohokrát


Nerozumím tomu. Může mi teda někdo poradit?

Moderátor jenikkozak: Nekonstruktivní příspěvky sloužící pouze ke zviditelnění dotazu jsou zakázané.

Dělám se s tím už několik dní


Musí se podle mě změnit něco tady, co to může bejt? Děkuji všem co mě pomůžou:

<? require('gen_inc.php'); if($valid == false) die(); ?>

      var gameslist = '<';
gameslist += 'table border="0" cellspacing="0" cellpadding="3" width="100%" class="smllfontwhite">';


<? $tableq = mysql_query("select gameID, p1name, p2name,p3name,p4name,p5name, p6name,p7name,p8name,p9name,p10name, p1pot, p2pot, p3pot, p4pot, p5pot, p6pot, p7pot, p8pot, p9pot, p10pot, tablename,tablelimit ,tabletype,hand,tablelow, pot from ".DB_POKER." order by tablelimit asc "); while($tabler = mysql_fetch_array($tableq)){ $i = 1; $x=0; $time = time(); $ktimer = DISCONNECT; $timekick = $time-$ktimer; $gamID = $tabler['gameID']; while($i < 11){ if(strlen($tabler['p'.$i.'name']) != ''){ $usr = $tabler['p'.$i.'name']; $pot = $tabler['p'.$i.'pot']; $ttq = mysql_query("select gID, timetag from ".DB_PLAYERS." where username = '".$usr."'  "); $ttr = mysql_fetch_array($ttq); if(($ttr['timetag'] < $timekick) || ($ttr['gID'] != $gamID)){ $result = mysql_query("update ".DB_POKER." set p".$i."name = '', p".$i."bet = '', p".$i."pot = '' , lastmove = '".($time+1)."' where gameID = '".$gamID."' "); $result = mysql_query("update ".DB_STATS." set winpot = winpot + ".$pot." where player  = '".$usr."'  "); $result = mysql_query("update ".DB_PLAYERS." set gID = '' where username = '".$usr."' "); } $x++; } $i++; } $tablename = $tabler['tablename']; $min = money_small($tabler['tablelow']); $tablelimit = $tabler['tablelimit']; $max = money_small($tablelimit); $gID = $tabler['gameID']; $tablemultiplier = 1; if($tablelimit == 25000) $tablemultiplier = 2; if($tablelimit == 50000) $tablemultiplier = 4; if($tablelimit == 100000) $tablemultiplier = 8; if($tablelimit == 250000) $tablemultiplier = 20; if($tablelimit == 500000) $tablemultiplier = 40; if($tablelimit == 1000000) $tablemultiplier = 80; if($tabler['tabletype'] == 't'){ $BB = money_small(50*$tablemultiplier).'-'.money_small(50*$tablemultiplier*9); $SB = money_small(25*$tablemultiplier).'-'.money_small(25*$tablemultiplier*9); }else{ $BB = money_small(200*$tablemultiplier); $SB = money_small(100*$tablemultiplier); } $tableplayers = $x.'/10'; $NEW_GAME = addslashes(NEW_GAME); $PLAYING = addslashes(PLAYING); $tablestatus = (($tabler['hand'] == '')? $NEW_GAME : $PLAYING); $TOURNAMENT = addslashes(TOURNAMENT); $SITNGO = addslashes(SITNGO); $tabletype = (($tabler['tabletype'] == 't')? $TOURNAMENT : $SITNGO); $buyin = (($tabler['tabletype'] == 't')? $max : $min.'/'.$max); ?>
        gameslist += '<tr onMouseOver="this.bgColor = \'#330000\'; this.style.color = \'#FFFFFF\';" onMouseOut="this.bgColor = \'\'; this.style.color = \'#FFFFFF\';"  onClick="selectgame(\'lobby.php?gameID=<? echo $gID; ?>\');" class="hand">'; 

          gameslist += '<td class="smllfontwhite" width="120"><? echo $tablename; ?></td><td width="50" align="center" class="smllfontwhite"><? echo $tableplayers; ?></td><td class="smllfontwhite" width="80" align="center"><? echo $tabletype; ?></td><td class="smllfontwhite" width="90" align="center"><? echo $buyin; ?></td><td class="smllfontwhite" width="90" align="center"><? echo $SB; ?></td><td class="smllfontwhite" width="90" align="center"><? echo $BB; ?></td><td class="smllfontwhite" width="80" align="center"><? echo $tablestatus; ?></td></tr>';
        <? } ?>
      gameslist += '</table>';
document.getElementById('gamelist').innerHTML = gameslist;
Lamicz
Profil
Jarunka14:
Sry, ale takovým způsobem píšeš zdroják?? Podívej se prosím na tzv. coding standards, toto se nedá číst, tzn. nikdo Ti neporadí
janomajka
Profil
Zkus přidat do .htaccess řádek: php_flag register_globals on . Ale jestli domena používá tuším že php5.4 , tak ta už to nepodporuje, a budeš to muset přepsat tak, aby se nepouživaly Globální proměnné, nedávno jsem řešil podobný problém Vložení JS do Wordpressu + Odesílaní mailu
jenikkozak
Profil
1) Jarunka14 má zde na diskusi ban,
2) Zapínání register_globals je nesmyslným vytvořením bezpečnostní díry. Zde na diskusi to prosím nikomu nedoporučuj.
Moderátor Chamurappi: Doplnil jsem vyjasňující odkaz.

Vaše odpověď

Mohlo by se hodit

Odkud se sem odkazuje


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0