Jump to content

IF THEN ELSE I DONT WANT TO WORK


jkewlo

Recommended Posts

Hey everyone so yeah back again.

 

i got a if statement pretty simple

 

check.php

 

sets the session

$_SESSION['Level'] = $rows['Level'];

 

now this is my if statement

<?
		$admin = $_SESSION['Level'];
		if($admin == '9'){
		echo "- <a href='Admin/mod.php'>Admin Login</a><br>"; 
		} else {
		echo "<br>";
		}
		?>

 

dont seem to be getting anything. at all and i have 9 set in the database for the admin user any help would be great

Link to comment
Share on other sites

Have you tried echoing out $admin and the session variables to ensure they are correct? 

 

Try to assign $admin = 9 to make sure your if statement works. 

 

You also don't need single quotes around integers.

Link to comment
Share on other sites

still isnt working correct.

i cant post the full code being that it is private and i cant. but this is part of it

 

check.php

if($count==1){
// Register $myusername, $mypassword and redirect to file "member.php"
$_SESSION['myusername']= $username;
$_SESSION['admin'] = $rows['level'];
$admin = $_SESSION['Level'];
session_register("username");
session_register("password");
session_register("admin");
header("location: member.php");
}
else {
echo "Wrong Username or Password";
}
?>

 

 

members.php

<?
            $sql1="SELECT * FROM news members" or die(mysql_error());
		// OREDER BY id DESC is order result by descending
		$result1=mysql_query($sql1);
		$rows1 = mysql_fetch_array($result1) or die(mysql_error());
		if($_SESSION['admin'] == 9){
		echo "- <a href='Admin/mod.php'>Admin Login</a><br>"; } else { echo "<br>1"; }

		?>

Link to comment
Share on other sites

still no luck

i dont know why it is passing as false and not true..

 

im just gonna go ahead and post all my code

 

Members.php

<?
session_start();
include("Data/connect.php");
?>
<!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=utf-8" />
<title>Eve Lounge - Eve Lounge</title>
<style type="text/css">
body {
                margin: 0px;
                padding:0px;
                /* background:url('/i/right_shader.gif') repeat-y right #4D4D57;        */
                font-family:Verdana,Arial;
                font-size: 8pt;
                
			background-image: url('img/backgroundtop.png');
			background-repeat: repeat-x;
                vertical-align: top;
        }

         td {
                font-family:Verdana,Arial;
                font-size: 8pt;
                color:white;
        }

        A:link{color: #ffa500;text-decoration: none}
        A:visited{color: #ffa500;text-decoration: none}
        A:active{color: #ffa500;text-decoration: none}
        A:hover{color: #ffa500;text-decoration: underline}

.no_link:hover{text-decoration: none}

        #contentarea{
	//border-right:    1px solid #8D8D94;
                padding: 3px;
        }

.top_menu
{
	background-color: #666666;
	border-top:1px solid #ffffff;
	border-bottom:1px solid #ffffff;
	height:48px;
	padding-left:110px;
}

        .character_photo
        {
	left:	25px;
	top:	15px;
	border:	1px solid #a8a8a8;
	position: absolute;
	float: left;
	z-index: 50;
}

.newsTitleImage
{
	left: 5px;
	float: left;
	margin-right: -40px;
	position: relative;
}

        .mbHead {
           BACKGROUND-COLOR:#4D4D57;
           COLOR:white;
           FONT-FAMILY:Verdana;
           FONT-SIZE:11px;
         }

        .mbForum{
           BACKGROUND-COLOR:#2C2C38;
           COLOR:white;
           FONT-FAMILY:Verdana;
           FONT-SIZE:11px;
         }

        tr.tr_matrix:hover
        {
                background: #3f3f3f;
        }

        .null { }

        .text_orange {
                color: #ffa500;
        }

#nav {
        /* background-color: #3D6197; */
        clear: both;
        padding-top: 5px;
        padding-left: 10px;
        border-bottom: 1px solid #000000;
        padding-bottom: 1px;
}

#nav a {
        /* font-size: .85em; */
        font-size: 1.2em;
        border-top: 1px solid #FFFFFF;
        border-left: 1px solid #FFFFFF;
        border-right: 1px solid #FFFFFF;
        border-bottom: 1px solid #4B4B4B;
        padding: .2em;
        padding-left: .5em;
        padding-right: .5em;
        padding-bottom: 0px;
        text-decoration: none;
        color: #ffffff;
        background-color: #4B4B4B;
}

#nav a:hover, #nav a.current {
        color: #000000;
        background-color: #E2E7F0;
        font-size: 1.2em;
        border-top: 1px solid #000000;
        border-left: 1px solid #000000;
        border-right: 1px solid #000000;
        border-bottom: 1px solid #E2E7F0;
}

.div_box0 {
        border:1px solid #ffffff;
        padding: 10px;
font-size: 1.1em;
}

.div_box1 {
background-color: #666666;
background-repeat: no-repeat;
border:1px solid #ffffff;
padding-left: 10px;
padding-right: 10px;
padding-top: 15px;
padding-bottom: 15px;
        font-size: 1.1em;
line-height:1.4em;

}.div_box2 {
background-color:
background-repeat: no-repeat;
border:1px solid #000000;

}

.div_ad_half_banner {
width: 234px;
padding: 6px;
/*	height: 60px;				*/
border:1px solid #ffffff;
/*	background:url('/i/bg_234x60.gif');	*/
}

input.user {
    padding-left: 20px;
    background: url(img/username.png);
    background-repeat: no-repeat;
    background-position: left center;
    
background-color:#FFFFFF;
}
input.pwd {
    padding-left: 20px;
    background: url(img/password.png);
    background-repeat: no-repeat;
    background-position: left center;
    
background-color:#FFFFFF;
}

.style1 {border: 1px solid #000000; font-weight: bold; }
</style>

</head>
<body bgcolor="#485b75">
<center>
<table width="1024" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="1024" height="150" valign="top"><a href="index.php"><img src="img/Banner.png" width="1024" height="150" border="0"/></a></td>
  </tr>
</table>
<table width="1024" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td height="218" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="166" height="23" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="165" height="23"><img src="img/Navigation.gif" border="0"/><br></td>
              </tr>
          </table></td>
        </tr>
      <tr>
        <td height="23" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="165" height="23"><a href="index.php"><img src="img/EveLounge.gif" border="0"/></a></td>
              </tr>
          </table></td>
        </tr>
      <tr>
        <td height="23" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="165" height="23"><a href="eveskills.php"><img src="img/EveSkills.gif" border="0"/></a></td>
              </tr>
          </table></td>
        </tr>
      <tr>
        <td height="23" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="165" height="23"><a href="everaces.php"><img src="img/EveRaces.gif" border="0"/></a></td>
              </tr>
          </table></td>
        </tr>
      <tr>
        <td height="22" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="166" height="22" valign="top"><a href="evestations.php"><img src="img/stations.png" border="0"/></a></td>
            </tr>
        </table></td>
        </tr>
      <tr>
        <td height="1"></td>
      </tr>
      <tr>
        <td height="22" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="166" height="22" valign="top"><a href="evemap.php"><img src="img/map.png" border="0"/></a></td>
              </tr>
        </table></td>
      </tr>
      <tr>
        <td height="75"> </td>
      </tr>
    </table></td>
    <td width="16"> </td>
    <td width="655" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="656" height="17" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="656" height="17" valign="top" class="div_box2"><div align="left"><strong>Eve Lounge News and Updates</strong></div></td>
            </tr>
        </table></td>
        </tr>
      <tr>
        <td height="75" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="656" height="1"></td>
          </tr>
          <tr>
            <td height="74" valign="top" class="div_box2">
              <?php
$sql="SELECT * FROM news members ORDER BY id DESC LIMIT 0, 2" or die(mysql_error());
// OREDER BY id DESC is order result by descending
$result=mysql_query($sql);
//$rows = mysql_fetch_array($result) or die(mysql_error());

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

echo "<b>". $rows['Subject']. "</b> | ". $rows['Date/Time'] ."";

echo "<br />";

echo "". $rows['Body'] . "<br><hr><br>";

// Exit looping and close connection
}

?>            </td>
          </tr>
        </table>        </td>
      </tr>
      <tr>
        <td height="4"></td>
      </tr>
      <tr>
        <td height="18" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="656" height="18" valign="top" class="style1"><div align="left">About Eve Lounge</div></td>
              </tr>
        </table></td>
      </tr>
      <tr>
        <td height="75" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="656" height="1"></td>
            </tr>
          <tr>
            <td height="74" valign="top" class="div_box2">
            Eve Lounge was created to give Information to users for the Massive Multilayer Online Role Playing Game (MMORPG for short)Eve-Online, The ability to check anything they want that goes on in the massive universe of Eve-Online. from checking killboard's to finding out information on mineral sales in a specific solar system getting players stats and getting player skills all tho the site is in beta we hope that it will be up and running ASAP. </td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td height="23"> </td>
      </tr>
    </table></td>
    <td width="12"> </td>
    <td colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="173" height="17" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="173" height="17" valign="top" class="div_box2"><div align="left"><strong>Welcome <font color="#999999"><? echo "". $_SESSION['myusername'] ."" ?></font></strong> </div></td>
          </tr>
        </table>        </td>
        </tr>
      <tr>
        <td height="75" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="175" height="1"></td>
            </tr>
          <tr>
            <td height="74" valign="top" class="div_box2">
            - <a href="member.php">Home</a><br />
            - <a href="myaccount.php">My Account</a><br />
            - <a href="myskills.php">My Skills</a><br />
            - <a href="mycorporation.php">My Corporation</a><br />
            - <a href="killboard.php">Killboard</a><br />
            <?
            $sql1="SELECT * FROM members" or die(mysql_error());
		// OREDER BY id DESC is order result by descending
		$result1=mysql_query($sql1);
		$rows1 = mysql_fetch_array($result1) or die(mysql_error());
		if($_SESSION['admin'] == 9){
		echo "- <a href='Admin/mod.php'>Admin Login</a><br>"; } else { echo "1<br>"; }

		?>
            - <a href="logout.php"><font color="red">Log Out</font></a>
           </td>
           </tr>
        </table>         </td>
      </tr>
      <tr>
        <td height="16"></td>
      </tr>
      <tr>
        <td height="14" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="173" height="14" valign="top" class="style1"><div align="left">Eve-Online Server Stats</div></td>
              </tr>
        </table></td>
      </tr>
      <tr>
        <td height="74" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="173" height="1"></td>
          </tr>
          <tr>
            <td height="73" valign="top" class="div_box2">
            <center>
            <?php
function GetEvePlayers()
{
// IP of gameserver (Tranquility)
$strEVEServer = '87.237.38.200';
// Serverport
$intPortNumber = 26000;
// Timeout
$strTimeOut = 8;

function string2hex($String)
{
if (trim($String) != '')
{
$strHex = '';
$intLength = strlen($String);
for ($intCounter = 0; $intCounter < $intLength; $intCounter++)
{
if ($intCounter > 0) $strBound="-"; else $strBound="";
$strHex.=$strBound.str_pad(dechex(ord($String[$intCounter])), 2, 0, STR_PAD_LEFT);
}
return $strHex;
}
}

$objFP = @fsockopen($strEVEServer, $intPortNumber, &$strErrumber, &$strErrString, $strTimeOut);
if (!$objFP)
{
$strResult = 'Server down';
}
else
{
$arrBuffer = fgets($objFP,41);
fclose($objFP);

$strResult = $arrBuffer[21].$arrBuffer[20];
$strResult = string2hex($strResult);
$strResult = hexdec($strResult);
}
return $strResult;
}


echo '<b>'.GetEvePlayers().'</b> Players Online';
?>
</center>            </td>
          </tr>
        </table>         </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td width="152" height="67"> </td>
    <td width="14"> </td>
    <td> </td>
    <td></td>
    <td></td>
    <td width="60"></td>
    <td width="115"></td>
  </tr>
  <tr>
    <td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="151" height="50" valign="top">Powered by:<br /><a href="http://eve-empa.com/"><img src="img/yapealblue.png" border="0"/></a></td>
          <td width="1"></td>
        </tr>
    </table></td>
    <td height="49"></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="13"></td>
    <td></td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="655" height="13" valign="top"> project by John Grissom <i>jkewlo at gmail.com</i>
Most of the images and content of this website is original property of EVE Online - CCP, <a href="http://www.eve-online.com/pnp/termsofuse.asp">full copyright notice</a>.</td>
        </tr>
    </table></td>
    <td></td>
    <td></td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="115" height="13">        </td>
      </tr>
    </table>    </td>
  </tr>
</table>
</center>
</body>
</html>

 

Check.php

 

<?php
session_start();
include("Data/connect.php");

// username and password sent from form
$username=$_POST['myusername'];
$password=$_POST['mypassword'];

$sql="SELECT * FROM members WHERE username='". $username ."' and password='". $password ."'";
$result=mysql_query($sql);

// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row

if($count==1){
// Register $myusername, $mypassword and redirect to file "member.php"
$_SESSION['myusername']= $username;
$_SESSION['admin'] = $rows['level'];
$admin = $_SESSION['Level'];

header("location: member.php");
}
else {
echo "Wrong Username or Password";
}
?>

 

Link to comment
Share on other sites

You never grab your info from your DB to do this

 

$_SESSION['admin'] = $rows['level'];

 

You need to populate the $rows array first.

 

I'm not going to sift through all the CSS in your first page, where do you define $_SESSION['Level']?

Link to comment
Share on other sites

<?
session_start();
include("Data/connect.php");
?>
<!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=utf-8" />
<title>Eve Lounge - Eve Lounge</title>

<body bgcolor="#485b75">
<center>
<table width="1024" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td width="1024" height="150" valign="top"><a href="index.php"><img src="img/Banner.png" width="1024" height="150" border="0"/></a></td>
  </tr>
</table>
<table width="1024" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td height="218" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="166" height="23" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="165" height="23"><img src="img/Navigation.gif" border="0"/><br></td>
              </tr>
          </table></td>
        </tr>
      <tr>
        <td height="23" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="165" height="23"><a href="index.php"><img src="img/EveLounge.gif" border="0"/></a></td>
              </tr>
          </table></td>
        </tr>
      <tr>
        <td height="23" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="165" height="23"><a href="eveskills.php"><img src="img/EveSkills.gif" border="0"/></a></td>
              </tr>
          </table></td>
        </tr>
      <tr>
        <td height="23" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="165" height="23"><a href="everaces.php"><img src="img/EveRaces.gif" border="0"/></a></td>
              </tr>
          </table></td>
        </tr>
      <tr>
        <td height="22" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="166" height="22" valign="top"><a href="evestations.php"><img src="img/stations.png" border="0"/></a></td>
            </tr>
        </table></td>
        </tr>
      <tr>
        <td height="1"></td>
      </tr>
      <tr>
        <td height="22" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="166" height="22" valign="top"><a href="evemap.php"><img src="img/map.png" border="0"/></a></td>
              </tr>
        </table></td>
      </tr>
      <tr>
        <td height="75"> </td>
      </tr>
    </table></td>
    <td width="16"> </td>
    <td width="655" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="656" height="17" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="656" height="17" valign="top" class="div_box2"><div align="left"><strong>Eve Lounge News and Updates</strong></div></td>
            </tr>
        </table></td>
        </tr>
      <tr>
        <td height="75" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="656" height="1"></td>
          </tr>
          <tr>
            <td height="74" valign="top" class="div_box2">
              <?php
$sql="SELECT * FROM news members ORDER BY id DESC LIMIT 0, 2" or die(mysql_error());
// OREDER BY id DESC is order result by descending
$result=mysql_query($sql);
//$rows = mysql_fetch_array($result) or die(mysql_error());

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

echo "<b>". $rows['Subject']. "</b> | ". $rows['Date/Time'] ."";

echo "<br />";

echo "". $rows['Body'] . "<br><hr><br>";

// Exit looping and close connection
}

?>            </td>
          </tr>
        </table>        </td>
      </tr>
      <tr>
        <td height="4"></td>
      </tr>
      <tr>
        <td height="18" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="656" height="18" valign="top" class="style1"><div align="left">About Eve Lounge</div></td>
              </tr>
        </table></td>
      </tr>
      <tr>
        <td height="75" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="656" height="1"></td>
            </tr>
          <tr>
            <td height="74" valign="top" class="div_box2">
            Eve Lounge was created to give Information to users for the Massive Multilayer Online Role Playing Game (MMORPG for short)Eve-Online, The ability to check anything they want that goes on in the massive universe of Eve-Online. from checking killboard's to finding out information on mineral sales in a specific solar system getting players stats and getting player skills all tho the site is in beta we hope that it will be up and running ASAP. </td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td height="23"> </td>
      </tr>
    </table></td>
    <td width="12"> </td>
    <td colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="173" height="17" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="173" height="17" valign="top" class="div_box2"><div align="left"><strong>Welcome <font color="#999999"><? echo "". $_SESSION['myusername'] ."" ?></font></strong> </div></td>
          </tr>
        </table>        </td>
        </tr>
      <tr>
        <td height="75" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="175" height="1"></td>
            </tr>
          <tr>
            <td height="74" valign="top" class="div_box2">
            - <a href="member.php">Home</a><br />
            - <a href="myaccount.php">My Account</a><br />
            - <a href="myskills.php">My Skills</a><br />
            - <a href="mycorporation.php">My Corporation</a><br />
            - <a href="killboard.php">Killboard</a><br />
            <?php
            $sql1="SELECT * FROM members" or die(mysql_error());
         // OREDER BY id DESC is order result by descending
         $result1=mysql_query($sql1);
         $rows1 = mysql_fetch_array($result1) or die(mysql_error());
         if($_SESSION['admin'] == 9){
         echo "- <a href='Admin/mod.php'>Admin Login</a><br>"; } else { echo "1<br>"; }
         
         ?>
            - <a href="logout.php"><font color="red">Log Out</font></a>
           </td>
           </tr>
        </table>         </td>
      </tr>
      <tr>
        <td height="16"></td>
      </tr>
      <tr>
        <td height="14" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="173" height="14" valign="top" class="style1"><div align="left">Eve-Online Server Stats</div></td>
              </tr>
        </table></td>
      </tr>
      <tr>
        <td height="74" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="173" height="1"></td>
          </tr>
          <tr>
            <td height="73" valign="top" class="div_box2">
            <center>
            <?php
function GetEvePlayers()
{
// IP of gameserver (Tranquility)
$strEVEServer = '87.237.38.200';
// Serverport
$intPortNumber = 26000;
// Timeout
$strTimeOut = 8;

function string2hex($String)
{
if (trim($String) != '')
{
$strHex = '';
$intLength = strlen($String);
for ($intCounter = 0; $intCounter < $intLength; $intCounter++)
{
if ($intCounter > 0) $strBound="-"; else $strBound="";
$strHex.=$strBound.str_pad(dechex(ord($String[$intCounter])), 2, 0, STR_PAD_LEFT);
}
return $strHex;
}
}

$objFP = @fsockopen($strEVEServer, $intPortNumber, &$strErrumber, &$strErrString, $strTimeOut);
if (!$objFP)
{
$strResult = 'Server down';
}
else
{
$arrBuffer = fgets($objFP,41);
fclose($objFP);

$strResult = $arrBuffer[21].$arrBuffer[20];
$strResult = string2hex($strResult);
$strResult = hexdec($strResult);
}
return $strResult;
}


echo '<b>'.GetEvePlayers().'</b> Players Online';
?>
</center>            </td>
          </tr>
        </table>         </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td width="152" height="67"> </td>
    <td width="14"> </td>
    <td> </td>
    <td></td>
    <td></td>
    <td width="60"></td>
    <td width="115"></td>
  </tr>
  <tr>
    <td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="151" height="50" valign="top">Powered by:<br /><a href="http://eve-empa.com/"><img src="img/yapealblue.png" border="0"/></a></td>
          <td width="1"></td>
        </tr>
    </table></td>
    <td height="49"></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td height="13"></td>
    <td></td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="655" height="13" valign="top"> project by John Grissom <i>jkewlo at gmail.com</i>
Most of the images and content of this website is original property of EVE Online - CCP, <a href="http://www.eve-online.com/pnp/termsofuse.asp">full copyright notice</a>.</td>
        </tr>
    </table></td>
    <td></td>
    <td></td>
    <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <!--DWLayoutTable-->
      <tr>
        <td width="115" height="13">        </td>
      </tr>
    </table>    </td>
  </tr>
</table>
</center>
</body>
</html>

took out the CSS i need to put that in a different folder meant to do that

 

<td height="74" valign="top" class="div_box2">
            - <a href="member.php">Home</a><br />
            - <a href="myaccount.php">My Account</a><br />
            - <a href="myskills.php">My Skills</a><br />
            - <a href="mycorporation.php">My Corporation</a><br />
            - <a href="killboard.php">Killboard</a><br />
            <?php
            $sql1="SELECT * FROM members" or die(mysql_error());
         // OREDER BY id DESC is order result by descending
         $result1=mysql_query($sql1);
         $rows1 = mysql_fetch_array($result1) or die(mysql_error());
         if($_SESSION['admin'] == 9){
         echo "- <a href='Admin/mod.php'>Admin Login</a><br>"; } else { echo "1<br>"; }
         
         ?>
            - <a href="logout.php"><font color="red">Log Out</font></a>
           </td>

Link to comment
Share on other sites

all i pretty much want is it to check if the database has 0 3 9, 0 being normal user 3 being mod 9 being admin

 

in my database i have

 

level

 

all i want for it to do is if the user has admin privileges if they do display the admin Log in link if not display a <br>

 

but for some stupid reason i cant make this possible

Link to comment
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.