Well on my server the registration and top GRB guilds scripts work fine... but other scrips like the login script from ProfNerwosol
it leaves me with a blank page.
also the rank script from Bulgaria.
this one leaves me with this.
I tried to reinstall PHP (wasnt easy) but I got the same error. My guess is tehre is an extension or settings that is off. Anyone have an idea?
PHP Code:
<?php
$dbhost = $_ENV['LOCAL_DOMAIN'];
$dbuser = 'Shaiya';
$dbpwd = 'Shaiya123';
// connect to SQL server
if (!$link = @mssql_connect("$dbhost","$dbuser","$dbpwd"))
{
print "Failed to connect to MSSQL server.";
};
// select database
if (!@mssql_select_db("PS_GameData",$link))
{
print "Failed to select database.";
};
// check who's online
$result = @mssql_query("SELECT LoginStatus, Family FROM Chars WHERE LoginStatus=1",$link);
// initialize veriables
$online = @mssql_num_rows($result);
$human = 0;
$elf = 0;
$vail = 0;
$nordein = 0;
// fill variables with data (who's online)
while($row = @mssql_fetch_array($result,MSSQL_NUM))
{
if (@mssql_num_rows($result)==0) return;
switch($row[1])
{
case 0: $human++;break;
case 1: $elf++;break;
case 2: $vail++;break;
case 3: $nordein++;break;
};
};
@mssql_free_result($result);
// Print number of online players
print "<table style=\"border: 1px solid black;\">
<tr><td colspan=2>Players online: </td><td>".$online."</td></tr>
<tr><td>Human: </td><td>".$human."</td></tr>
<tr><td>Elf: </td><td>".$elf."</td></tr>
<tr><td>Vail: </td><td>".$vail."</td></tr>
<tr><td>DeathEater: </td><td>".$nordein."</td></tr>
</table>";
@mssql_close($link);
?>
also the rank script from Bulgaria.
PHP Code:
<?php
//here you must to replace data with your
$server = 'l127.0.0.1';
$dbuser = 'Shaiya';
$dbpass = 'Shaiya123';
$count=1;
$rimg=0;
$cimg=0;
$kdr=0;
//joker's remake : variable "$topcount" defined rows (1~N) in the table of top(N) players.
$topcount=100;
//connection with database
$conn = mssql_connect($server, $dbuser, $dbpass)
or die("Couldn't connect to SQL Server on $myServer");
$query = "SELECT * FROM PS_GameData.dbo.chars ORDER BY k1 desc";
$result = mssql_query($query);
echo "<html><head><STYLE TYPE=\"text/css\">
<!--
td { background:url(image.png) no-repeat; }
td.i0{ background-position: 0 0; width: 28px; height: 16px; }
td.i1{ background-position: 0 -26px; width: 28px; height: 16px; }
td.i2{ background-position: 0 -52px; width: 28px; height: 16px; }
td.i3{ background-position: 0 -78px; width: 29px; height: 16px; }
td.i4{ background-position: 0 -104px; width: 29px; height: 15px; }
td.i5{ background-position: 0 -129px; width: 28px; height: 18px; }
td.i6{ background-position: 0 -157px; width: 30px; height: 17px; }
td.i7{ background-position: 0 -184px; width: 29px; height: 17px; }
td.i8{ background-position: 0 -211px; width: 28px; height: 16px; }
td.i9{ background-position: 0 -237px; width: 28px; height: 18px; }
td.i10{ background-position: 0 -265px; width: 29px; height: 18px; }
td.i11{ background-position: 0 -293px; width: 29px; height: 24px; }
td.i12{ background-position: 0 -327px; width: 29px; height: 18px; }
td.i13{ background-position: 0 -355px; width: 29px; height: 18px; }
td.i14{ background-position: 0 -383px; width: 29px; height: 18px; }
td.i15{ background-position: 0 -411px; width: 29px; height: 18px; }
td.i16{ background-position: 0 -439px; width: 29px; height: 18px; }
td.i17{ background-position: 0 -467px; width: 24px; height: 24px; }
td.i18{ background-position: 0 -501px; width: 24px; height: 24px; }
td.i19{ background-position: 0 -535px; width: 24px; height: 24px; }
td.i20{ background-position: 0 -569px; width: 24px; height: 24px; }
td.i21{ background-position: 0 -603px; width: 24px; height: 24px; }
td.i22{ background-position: 0 -637px; width: 24px; height: 24px; }
</STYLE>
<title>PvP Rankings</title></head>";
echo "<body><center>
<table cellspacing=10 cellpadding=0 border=0 bgcolor=\"black\">
<td style=\"color:#FC9700\" bgcolor=\"black\">Rank</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">Name</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">Class</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">Level</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">Kills</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">Death</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">KDR</td>
<td style=\"color:#FC9700\" bgcolor=\"black\">Rank";
//joker's remake : check the end of table
while($count != ($topcount+1))
{
//joker's remake : get status of the player
$row = mssql_fetch_array($result);
$status = mssql_query(" SELECT UserUID,Status FROM PS_UserData.dbo.Users_Master WHERE UserUID = $row[2]",$conn);
$row1 = mssql_fetch_array($status);
//joker's remake : check that status=0 ,so eliminate all banned players ,GM,GMA
if($row1[1] == 0)
{
if($row[39] >= 200000)
$rimg=16;
else if($row[39] >= 150000)
$rimg=15;
else if($row[39] >= 130000)
$rimg=14;
else if($row[39] >= 110000)
$rimg=13;
else if($row[39] >= 90000)
$rimg=12;
else if($row[39] >= 70000)
$rimg=11;
else if($row[39] >= 50000)
$rimg=10;
else if($row[39] >= 40000)
$rimg=9;
else if($row[39] >= 30000)
$rimg=8;
else if($row[39] >= 20000)
$rimg=7;
else if($row[39] >= 10000)
$rimg=6;
else if($row[39] >= 5000)
$rimg=5;
else if($row[39] >= 1000)
$rimg=4;
else if($row[39] >= 300)
$rimg=3;
else if($row[39] >= 50)
$rimg=2;
else if($row[39] >= 1)
$rimg=1;
else
$rimg=0;
$cimg = $row[13]+17;
if($row[40]===0)
$kdr=number_format($row[39]/1,3,'.','');
else
$kdr=number_format($row[39]/$row[40],3,'.','');
echo "<tr style=\"color:white\">";
echo "<td>$count</td><td>". $row[4] ."</td><td class=\"i$cimg\"></td><td>". $row[15] ."</td><td>". $row[39] . "</td><td>". $row[40] . "</td><td>".$kdr."</td><td class=\"i$rimg\"></td>";
echo "</tr>";
$count++;
}
}
echo "</table>";
echo "</html>";
mssql_close($conn);
?>
this one leaves me with this.
Code:
Call to undefined function mssql_fetch_array() in C:\inetpub\wwwroot\rank.php on line 65