Jump to content

Recommended Posts

Heres My Script

 

 

<?

session_start(); 

 

if (!(isset($_SESSION["real_name"])))

{

//echo "I'm not logged in";

header('Location: login.php');

}

else

{

echo "";

}

 

 

?>

 

 

 

<html>

<head>

<title>Midcity-Mafia :: Countries</title></head>

    <link REL="stylesheet" TYPE="text/css" HREF="main.css">

 

<script language=javascript src=Menus.js></script>

 

<body background="wallpaper.jpg">

<center>

<table border="0" cellspacing="0" cellpadding="0" align="center" width="95%" class="cat">

 

<TR>

 

<TD width="150" background="tdbg3.jpg" bgcolor="#222222" valign="top">

<?php include("leftmenu.php");?>

</TD>

 

    <td width="100%" valign="top"> <br>

 

 

 

 

<table border="1" cellspacing="0" cellpadding="2" bordercolor="black" align="center" width="75%" class="sub2">

    <tr>

      <td class="header" colspan="15" align="center">Countries</td>

    </tr>

<tr>

<td colspan="1" class="header" align="center">Country</td>

<td colspan="1" class="header" align="center">Bullet Owner</td>

<td colspan="1" class="header" align="center">Roulette</td>

<td colspan="1" class="header" align="center">Slots</td>

<td colspan="1" class="header" align="center">Racetrack</td>

<td colspan="1" class="header" align="center">Dice</td>

</tr>

<?

 

 

$sql="SELECT * from countries WHERE place='Italy'";

$result=mysql_query($sql);

 

while($rows=mysql_fetch_array($result)){ // Start looping table row

 

$BF = $rows['BF'];

$roulette = $rows['roulette'];

$slots = $rows['slots'];

$racetrack = $rows['racetrack'];

$dice = $rows['dice'];

 

?>

<tr>

<td colspan="1">Italy</td>

<td colspan="1">

<?

if ($BF == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['BF']; ?>'> <? echo $rows['BF']; ?></a>

<? } ?>

</td>

 

<td colspan="1">

<?

if ($roulette == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['roulette']; ?>'><? echo $rows['roulette']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($slots == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['slots']; ?>'><? echo $rows['slots']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($racetrack == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['racetrack']; ?>'><? echo $rows['racetrack']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($dice == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['dice']; ?>'><? echo $rows['dice']; ?></a>

<? } ?>

</td>

 

</tr>

<? } ?>

<?

 

 

$sql="SELECT * from countries WHERE place='France'";

$result=mysql_query($sql);

 

while($rows=mysql_fetch_array($result)){ // Start looping table row

 

$BF = $rows['BF'];

$roulette = $rows['roulette'];

$slots = $rows['slots'];

$racetrack = $rows['racetrack'];

$dice = $rows['dice'];

 

?>

<tr>

<td colspan="1">France</td>

<td colspan="1">

<?

if ($BF == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['BF']; ?>'> <? echo $rows['BF']; ?></a>

<? } ?>

</td>

 

<td colspan="1">

<?

if ($roulette == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['roulette']; ?>'><? echo $rows['roulette']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($slots == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['slots']; ?>'><? echo $rows['slots']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($racetrack == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['racetrack']; ?>'><? echo $rows['racetrack']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($dice == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['dice']; ?>'><? echo $rows['dice']; ?></a>

<? } ?>

</td>

 

</tr>

<? } ?>

<?

 

 

$sql="SELECT * from countries WHERE place='Nigeria'";

$result=mysql_query($sql);

 

while($rows=mysql_fetch_array($result)){ // Start looping table row

 

$BF = $rows['BF'];

$roulette = $rows['roulette'];

$slots = $rows['slots'];

$racetrack = $rows['racetrack'];

$dice = $rows['dice'];

 

?>

<tr>

<td colspan="1">Nigeria</td>

<td colspan="1">

<?

if ($BF == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['BF']; ?>'> <? echo $rows['BF']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($roulette == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['roulette']; ?>'><? echo $rows['roulette']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($slots == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['slots']; ?>'><? echo $rows['slots']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($racetrack == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['racetrack']; ?>'><? echo $rows['racetrack']; ?></a>

<? } ?>

</td><td colspan="1">

<?

if ($dice == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['dice']; ?>'><? echo $rows['dice']; ?></a>

<? } ?>

</td>

 

</tr>

<? } ?>

 

<?

 

 

$sql="SELECT * from countries WHERE place='America'";

$result=mysql_query($sql);

 

while($rows=mysql_fetch_array($result)){ // Start looping table row

 

$BF = $rows['BF'];

$roulette = $rows['roulette'];

$slots = $rows['slots'];

$racetrack = $rows['racetrack'];

$dice = $rows['dice'];

 

?>

<tr>

<td colspan="1">America</td>

<td colspan="1">

<?

if ($BF == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['BF']; ?>'> <? echo $rows['BF']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($roulette == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['roulette']; ?>'><? echo $rows['roulette']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($slots == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['slots']; ?>'><? echo $rows['slots']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($racetrack == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['racetrack']; ?>'><? echo $rows['racetrack']; ?></a>

<? } ?>

</td><td colspan="1">

<?

if ($dice == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['dice']; ?>'><? echo $rows['dice']; ?></a>

<? } ?>

</td>

 

</tr>

<? } ?>

 

<?

 

 

$sql="SELECT * from countries WHERE place='France'";

$result=mysql_query($sql);

 

while($rows=mysql_fetch_array($result)){ // Start looping table row

 

$BF = $rows['BF'];

$roulette = $rows['roulette'];

$slots = $rows['slots'];

$racetrack = $rows['racetrack'];

$dice = $rows['dice'];

 

?>

 

<? } ?>

<?

 

 

$sql="SELECT * from countries WHERE place='England'";

$result=mysql_query($sql);

 

while($rows=mysql_fetch_array($result)){ // Start looping table row

 

$BF = $rows['BF'];

$roulette = $rows['roulette'];

$slots = $rows['slots'];

$racetrack = $rows['racetrack'];

$dice = $rows['dice'];

 

?>

<tr>

<td colspan="1">England</td>

<td colspan="1">

<?

if ($BF == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['BF']; ?>'> <? echo $rows['BF']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($roulette == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['roulette']; ?>'><? echo $rows['roulette']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($blackjack == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['bj']; ?>'><? echo $rows['bj']; ?></a>

<? } ?>

</td>

<td colspan="1">

<?

if ($racetrack == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['racetrack']; ?>'><? echo $rows['racetrack']; ?></a>

<? } ?>

</td><td colspan="1">

<?

if ($dice == "None"){

 

echo "None";

}else{

?>

<a href='viewprofile.php?viewuser=<? echo $rows['dice']; ?>'><? echo $rows['dice']; ?></a>

<? } ?>

</td>

 

</tr>

<? } ?>

<tr>

<td colspan="7">

<font color="red">Users are only allowed to hold a maximum of 1 casino and bullet factory each.</font>

</td></tr>

</table>

<br><br>

 

 

</td>

 

 

 

    <TD width="150" valign="top">

<?php include("rightmenu.php");?>

</TD>

 

</TR>

 

 

</table>

 

</center>

</body>

</html>

 

 

The Page should show the owners of casinos, but it doesnt, anyone help?

Link to comment
https://forums.phpfreaks.com/topic/175974-help-with-mafia-game/
Share on other sites

1) Use [/code]

 tags.

2) What have you done to diagnose the problem?

3) Post only the relevant code.

4) Don't use short hand PHP tags, use <?php tags.

5) I don't see anything that even resembles you trying to get the owners...  (Assuming it's coming from the DB)

Link to comment
https://forums.phpfreaks.com/topic/175974-help-with-mafia-game/#findComment-927320
Share on other sites

Why not do something along these lines?

<?php
session_start();  

if (!(isset($_SESSION["real_name"])))
{
   //echo "I'm not logged in";
   header('Location: login.php');
}
else
{
   echo "";
}


?>



<html>
<head>
<title>Midcity-Mafia :: Countries</title></head>
       <link REL="stylesheet" TYPE="text/css" HREF="main.css">

<script language=javascript src=Menus.js></script>

<body background="wallpaper.jpg">
<center> 
<table border="0" cellspacing="0" cellpadding="0" align="center" width="95%" class="cat">

   <TR> 
   
<TD width="150" background="tdbg3.jpg" bgcolor="#222222" valign="top">
<?php include("leftmenu.php");?>
</TD>
     
    <td width="100%" valign="top">   <br>   




   <table border="1" cellspacing="0" cellpadding="2" bordercolor="black" align="center" width="75%" class="sub2">
    <tr>
      <td class="header" colspan="15" align="center">Countries</td>
    </tr>
         <tr>
   <td colspan="1" class="header" align="center">Country</td>
   <td colspan="1" class="header" align="center">Bullet Owner</td>
   <td colspan="1" class="header" align="center">Roulette</td>
   <td colspan="1" class="header" align="center">Slots</td>
   <td colspan="1" class="header" align="center">Racetrack</td>
   <td colspan="1" class="header" align="center">Dice</td>
   </tr>
<?php
$sql="SELECT BF, roulette, slots, racetrack, dice, place from countries ORDER BY place";
$result=mysql_query($sql);

while($rows=mysql_fetch_row($result)){ // Start looping table row 

$BF        = $rows[0];
$roulette  = $rows[1];
$slots     = $rows[2];
$racetrack = $rows[3];
$dice      = $rows[4];
$place     = $rows[5];

?>
   <tr>
   <td colspan="1"><?php echo $place; ?></td>
   <td colspan="1">
   <?
if ($BF == "None"){

echo "None";
}else{
?>
<a href='viewprofile.php?viewuser=<?php echo $BF; ?>'> <?php echo $BF; ?></a>
<?php } ?>
   </td>
   
   <td colspan="1">
   <?php
if ($roulette == "None"){

echo "None";
}else{
   ?>
   <a href='viewprofile.php?viewuser=<?php echo $roulette; ?>'><?php echo $roulette; ?></a>
   <?php } ?>
   </td>
   <td colspan="1">
      <?php
if ($slots == "None"){

echo "None";
}else{
   ?>
   <a href='viewprofile.php?viewuser=<?php echo $slots; ?>'><?php echo $slots; ?></a>
<?php } ?>   
   </td>
   <td colspan="1">
      <?php
if ($racetrack == "None"){

echo "None";
}else{
   ?>
   <a href='viewprofile.php?viewuser=<?php echo $racetrack; ?>'><?php echo $racetrack; ?></a>
<?php } ?>   
   </td>
   <td colspan="1">
      <?php
if ($dice == "None"){

echo "None";
}else{
   ?>
   <a href='viewprofile.php?viewuser=<?php echo $dice; ?>'><?php echo $dice; ?></a>
   <?php } ?>
   </td>
      
   </tr>
   <?php } ?>
   <tr>
   <td colspan="7">
   <font color="red">Users are only allowed to hold a maximum of 1 casino and bullet factory each.</font>
   </td></tr>
   </table>
   <br><br>
   
   
   </td>
   

   
          <TD width="150" valign="top">
<?php include("rightmenu.php");?>
</TD>
   
   </TR>
   

</table>

</center>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/175974-help-with-mafia-game/#findComment-927336
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.