Един път имаш "$online_check" направи поне "$online_check = mssql_num_rows($online_check); " на "$online_check1 = mssql_num_rows($online_check); "
И защо два пъти проверяваш стартираната сесия ;P (fubar) нали има "$username = $_SESSION['member_username'];" ;P
М/у другото мисля, че няма да работи и това варианта който дадох съм сигорен, че при всички ще работи и няма да има проблеми ;P
И ся в крайна сметка ?
НО несъм сигорен !elseif ($onlinecheck[0] == 1){ echo "<td><br><font size=2>Account is online, must be logged off!</font><br><br></td>"; $error=1; }
ММ не поне от мойте малки познания може грешката да идва от
НО несъм сигорен !
<?php
ob_start();
session_start();
$username = $_SESSION['member_username'];
$password = $_SESSION['member_password'];
$character = $_SESSION['character'];
include("./config.php");
include("../inc/sqlcfg.php");
secure($_POST['username']);
secure($_POST['password']);
secure($_POST['character']);
$md5 = mssql_query("SELECT * FROM misc WHERE id=4");
$md5 = mssql_fetch_array($md5);
$md5 = $md5['misc'];
if($md5 == 1)
{
$check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd=[dbo].[fn_md5]('$password','$username')");
}
else
{
$check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd='$password'");
}
function level_reset() {
{
$char = secure($_POST['chars']);
$char = str_replace("'" , "", $char);
$char = str_replace(";" , "", $char);
$resmoney = '0';
$reslevel = '1';
$maxres = '2000';
$respoints = '500';
global $web;
$q= mssql_query("SELECT TOP 25 Name,AccountID from Character order by Resets desc");
$row1 = mssql_fetch_row($q);
$username_check = mssql_query("SELECT Name FROM Character WHERE Name='$char' and AccountID = '$username'");
$username_checked = mssql_num_rows($username_check);
$online_check="select ConnectStat from MEMB_STAT where memb___id='$row1[1]'";
$online_check_chek=mssql_query($online_check);
$onlinecheck=mssql_fetch_row($online_check_chek);
$hero = mssql_query("SELECT * FROM Character WHERE Name='$char'");
$row = mssql_fetch_array($hero);
if (empty($char)) { echo "<td><br><font size=2>Please select Character!</font><br><br></td>"; $error=1; }
elseif ($onlinecheck[0] == 1){ echo "<td><br><font size=2>Account is online, must be logged off!</font><br><br></td>"; $error=1; }
elseif ($row['Money'] < $resmoney) { echo "<td><br><font size=2><b>$char</b> need [<b>$resmoney</b>] zen to Reset!</font><br><br></td>"; $error=1; }
elseif ($row['cLevel'] < $reslevel){ echo "<td><br><font size=2><b>$char</b> need level [<b>$reslevel</b>] to Reset!</font><br><br></td>"; $error=1; }
elseif ($row['Resets'] >= $maxres) { echo "<td><br><font size=2>You have reach maximum resets! Cannot reset this hero!</font><br><br></td>"; $error=1; }
if($error !=1) {
$resetup = $row['Resets'] + (1);
$money = $row['Money'] - $resmoney;
$reset_points = "UPDATE character SET [LevelUpPoint]='$respoints',[Money]='$money',cLevel='1',Experience='0',[MapNumber]='0',[MapPosX]='125',[MapPosY]='128',[Resets]='$resetup' WHERE Name='$char'";
$reset_results = mssql_query($reset_points);
echo "<td><br><font size=2><b>$char</b> has been reset!</font><br><br></td>";
}
}
}
?>
Пиши във скайп ston3angel
МММ Не ;(
А стига бе немое да бъде колко варианта дадох и неще... :O :eh:
<?php
ob_start();
session_start();
$username = $_SESSION['member_username'];
$password = $_SESSION['member_password'];
$character = $_SESSION['character'];
include ("./config.php");
include ("../inc/sqlcfg.php");
secure($_POST['username']);
secure($_POST['password']);
secure($_POST['character']);
$md5 = mssql_query("SELECT * FROM misc WHERE id=4");
$md5 = mssql_fetch_array($md5);
$md5 = $md5['misc'];
if ($md5 == 1)
{
$check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd=[dbo].[fn_md5]('$password','$username')");
}
else
{
$check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd='$password'");
}
function level_reset()
{
{
$char = secure($_POST['chars']);
$char = str_replace("'", "", $char);
$char = str_replace(";", "", $char);
$resmoney = '100000000';
$reslevel = '400';
$maxres = '999';
$respoints = '500';
global $web;
$username_check = mssql_query("SELECT Name FROM Character WHERE Name='$char' and AccountID = '$username'");
$username_checked = mssql_num_rows($username_check);
$online_check = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$username'");
$online_checked = mssql_fetch_array($online_check);
if ($online_checked['ConnectStat'] == "1")
{
echo "В игра си";
}
else
{
$hero = mssql_query("SELECT * FROM Character WHERE Name='$char'");
$row = mssql_fetch_array($hero);
if (empty($char))
{
echo "<td><br><font size=2>Please select Character!</font><br><br></td>";
$error = 1;
} elseif ($online_checked['ConnectStat'] != 0)
{
echo "<td><br><font size=2>Account is online, must be logged off!</font><br><br></td>";
$error = 1;
} elseif ($row['Money'] < $resmoney)
{
echo "<td><br><font size=2><b>$char</b> need <b>$resmoney</b> zen to Reset!</font><br><br></td>";
$error = 1;
} elseif ($row['cLevel'] < $reslevel)
{
echo "<td><br><font size=2><b>$char</b> need level <b>$reslevel</b> to Reset!</font><br><br></td>";
$error = 1;
} elseif ($row['Resets'] >= $maxres)
{
echo "<td><br><font size=2>You have reach maximum resets! Cannot reset this hero!</font><br><br></td>";
$error = 1;
}
if ($error != 1)
{
$newstats = $respoints * ($row['Resets']);
$resetup = $row['Resets'] + (1);
$money = $row['Money'] - $resmoney;
$reset_points = "UPDATE [MuOnline].[dbo].[Character] SET [cLevel]='1',[Experience]='0',[LevelUpPoint]=' +100',[Money]='$money',[MapNumber]='0',[MapPosX]='125',[MapPosY]='128',[Resets]='$resetup' WHERE Name='$char'";
$reset_results = mssql_query($reset_points);
echo "<td><br><font size=2><b>$char</b> have [<b>$newstats</b>] level up points!</font><br><br></td>";
}
}
}
}
?>
Дава ми че нямам зенPHP:<?php ob_start(); session_start(); $username = $_SESSION['member_username']; $password = $_SESSION['member_password']; $character = $_SESSION['character']; include ("./config.php"); include ("../inc/sqlcfg.php"); secure($_POST['username']); secure($_POST['password']); secure($_POST['character']); $md5 = mssql_query("SELECT * FROM misc WHERE id=4"); $md5 = mssql_fetch_array($md5); $md5 = $md5['misc']; if ($md5 == 1) { $check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd=[dbo].[fn_md5]('$password','$username')"); } else { $check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd='$password'"); } function level_reset() { { $char = secure($_POST['chars']); $char = str_replace("'", "", $char); $char = str_replace(";", "", $char); $resmoney = '100000000'; $reslevel = '400'; $maxres = '999'; $respoints = '500'; global $web; $username_check = mssql_query("SELECT Name FROM Character WHERE Name='$char' and AccountID = '$username'"); $username_checked = mssql_num_rows($username_check); $online_check = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$username'"); $online_checked = mssql_fetch_array($online_check); if ($online_checked['ConnectStat'] == "1") { echo "В игра си"; } else { $hero = mssql_query("SELECT * FROM Character WHERE Name='$char'"); $row = mssql_fetch_array($hero); if (empty($char)) { echo "<td><br><font size=2>Please select Character!</font><br><br></td>"; $error = 1; } elseif ($online_checked['ConnectStat'] != 0) { echo "<td><br><font size=2>Account is online, must be logged off!</font><br><br></td>"; $error = 1; } elseif ($row['Money'] < $resmoney) { echo "<td><br><font size=2><b>$char</b> need <b>$resmoney</b> zen to Reset!</font><br><br></td>"; $error = 1; } elseif ($row['cLevel'] < $reslevel) { echo "<td><br><font size=2><b>$char</b> need level <b>$reslevel</b> to Reset!</font><br><br></td>"; $error = 1; } elseif ($row['Resets'] >= $maxres) { echo "<td><br><font size=2>You have reach maximum resets! Cannot reset this hero!</font><br><br></td>"; $error = 1; } if ($error != 1) { $newstats = $respoints * ($row['Resets']); $resetup = $row['Resets'] + (1); $money = $row['Money'] - $resmoney; $reset_points = "UPDATE [MuOnline].[dbo].[Character] SET [cLevel]='1',[Experience]='0',[LevelUpPoint]=' +100',[Money]='$money',[MapNumber]='0',[MapPosX]='125',[MapPosY]='128',[Resets]='$resetup' WHERE Name='$char'"; $reset_results = mssql_query($reset_points); echo "<td><br><font size=2><b>$char</b> have [<b>$newstats</b>] level up points!</font><br><br></td>"; } } } } ?>
<?php
ob_start();
session_start();
$username = $_SESSION['member_username'];
$password = $_SESSION['member_password'];
$character = $_SESSION['character'];
include ("./config.php");
include ("../inc/sqlcfg.php");
secure($_POST['username']);
secure($_POST['password']);
secure($_POST['character']);
$md5 = mssql_query("SELECT * FROM misc WHERE id=4");
$md5 = mssql_fetch_array($md5);
$md5 = $md5['misc'];
if ($md5 == 1)
{
$check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd=[dbo].[fn_md5]('$password','$username')");
}
else
{
$check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd='$password'");
}
function level_reset()
{
{
$char = secure($_POST['chars']);
$char = str_replace("'", "", $char);
$char = str_replace(";", "", $char);
$resmoney = '100000000';
$reslevel = '400';
$maxres = '999';
$respoints = '500';
global $web;
$username_check = mssql_query("SELECT Name FROM Character WHERE Name='$char' and AccountID = '$username'");
$username_checked = mssql_num_rows($username_check);
$online_check = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$username'");
$online_checked = mssql_fetch_array($online_check);
if ($online_checked['ConnectStat'] == "1")
{
echo "В игра си";
}
else
{
$hero = mssql_query("SELECT * FROM Character WHERE Name='$char'");
$row = mssql_fetch_array($hero);
echo $row['Money']." - $resmoney";
if (empty($char))
{
echo "<td><br><font size=2>Please select Character!</font><br><br></td>";
$error = 1;
} elseif ($online_checked['ConnectStat'] != 0)
{
echo "<td><br><font size=2>Account is online, must be logged off!</font><br><br></td>";
$error = 1;
} elseif ($row['Money'] < $resmoney)
{
echo "<td><br><font size=2><b>$char</b> need <b>$resmoney</b> zen to Reset!</font><br><br></td>";
$error = 1;
} elseif ($row['cLevel'] < $reslevel)
{
echo "<td><br><font size=2><b>$char</b> need level <b>$reslevel</b> to Reset!</font><br><br></td>";
$error = 1;
} elseif ($row['Resets'] >= $maxres)
{
echo "<td><br><font size=2>You have reach maximum resets! Cannot reset this hero!</font><br><br></td>";
$error = 1;
}
if ($error != 1)
{
$newstats = $respoints * ($row['Resets']);
$resetup = $row['Resets'] + (1);
$money = $row['Money'] - $resmoney;
$reset_points = "UPDATE [MuOnline].[dbo].[Character] SET [cLevel]='1',[Experience]='0',[LevelUpPoint]=' +100',[Money]='$money',[MapNumber]='0',[MapPosX]='125',[MapPosY]='128',[Resets]='$resetup' WHERE Name='$char'";
$reset_results = mssql_query($reset_points);
echo "<td><br><font size=2><b>$char</b> have [<b>$newstats</b>] level up points!</font><br><br></td>";
}
}
}
}
?>
<?php
ob_start();
session_start();
$username = $_SESSION['member_username'];
$password = $_SESSION['member_password'];
$character = $_SESSION['character'];
include("./config.php");
include("../inc/sqlcfg.php");
secure($_POST['username']);
secure($_POST['password']);
secure($_POST['character']);
$md5 = mssql_query("SELECT * FROM misc WHERE id=4");
$md5 = mssql_fetch_array($md5);
$md5 = $md5['misc'];
if($md5 == 1)
{
$check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd=[dbo].[fn_md5]('$password','$username')");
}
else
{
$check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd='$password'");
}
function level_reset() {
{
$char = secure($_POST['chars']);
$char = str_replace("'" , "", $char);
$char = str_replace(";" , "", $char);
$resmoney = '0';
$reslevel = '1';
$maxres = '2000';
$respoints = '500';
global $web;
$q= mssql_query("SELECT TOP 25 Name,AccountID from Character order by Resets desc");
$row1 = mssql_fetch_row($q);
$username_check = mssql_query("SELECT Name FROM Character WHERE Name='$char' and AccountID = '$username'");
$username_checked = mssql_num_rows($username_check);
$online_query = mssql_query("SELECT * From MEBM_STAT where memb___id='$char' and Connectstat='1'");
$online_result = mssql_num_rows($online_query);
$hero = mssql_query("SELECT * FROM Character WHERE Name='$char'");
$row = mssql_fetch_array($hero);
if (empty($char)) { echo "<td><br><font size=2>Please select Character!</font><br><br></td>"; $error=1; }
elseif ($online_result == 1){ echo "<td><br><font size=2>Account is online, must be logged off!</font><br><br></td>"; $error=1; }
elseif ($row['Money'] < $resmoney) { echo "<td><br><font size=2><b>$char</b> need [<b>$resmoney</b>] zen to Reset!</font><br><br></td>"; $error=1; }
elseif ($row['cLevel'] < $reslevel){ echo "<td><br><font size=2><b>$char</b> need level [<b>$reslevel</b>] to Reset!</font><br><br></td>"; $error=1; }
elseif ($row['Resets'] >= $maxres) { echo "<td><br><font size=2>You have reach maximum resets! Cannot reset this hero!</font><br><br></td>"; $error=1; }
if($error !=1) {
$resetup = $row['Resets'] + (1);
$money = $row['Money'] - $resmoney;
$reset_points = "UPDATE character SET [LevelUpPoint]='$respoints',[Money]='$money',cLevel='1',Experience='0',[MapNumber]='0',[MapPosX]='125',[MapPosY]='128',[Resets]='$resetup' WHERE Name='$char'";
$reset_results = mssql_query($reset_points);
echo "<td><br><font size=2><b>$char</b> has been reset!</font><br><br></td>";
}
}
}
?>
Fatal error: Call to undefined function mssql_numb_rows() in C:\xampp\htdocs\modules\clear_reset_do.php on line 40
ПОказва ги но пак става
На второто дава
PHP:<?php ob_start(); session_start(); $username = $_SESSION['member_username']; $password = $_SESSION['member_password']; $character = $_SESSION['character']; include("./config.php"); include("../inc/sqlcfg.php"); secure($_POST['username']); secure($_POST['password']); secure($_POST['character']); $md5 = mssql_query("SELECT * FROM misc WHERE id=4"); $md5 = mssql_fetch_array($md5); $md5 = $md5['misc']; if($md5 == 1) { $check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd=[dbo].[fn_md5]('$password','$username')"); } else { $check = mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$username' AND memb__pwd='$password'"); } function level_reset() { { $char = secure($_POST['chars']); $char = str_replace("'" , "", $char); $char = str_replace(";" , "", $char); $resmoney = '0'; $reslevel = '1'; $maxres = '2000'; $respoints = '500'; global $web; $q= mssql_query("SELECT TOP 25 Name,AccountID from Character order by Resets desc"); $row1 = mssql_fetch_row($q); $username_check = mssql_query("SELECT Name FROM Character WHERE Name='$char' and AccountID = '$username'"); $username_checked = mssql_num_rows($username_check); $online_query = mssql_query("SELECT * From MEBM_STAT where memb___id='$character' and Connectstat='1'"); $online_result = mssql_num_rows($online_query); $hero = mssql_query("SELECT * FROM Character WHERE Name='$char'"); $row = mssql_fetch_array($hero); if (empty($char)) { echo "<td><br><font size=2>Please select Character!</font><br><br></td>"; $error=1; } elseif ($online_result == 1){ echo "<td><br><font size=2>Account is online, must be logged off!</font><br><br></td>"; $error=1; } elseif ($row['Money'] < $resmoney) { echo "<td><br><font size=2><b>$char</b> need [<b>$resmoney</b>] zen to Reset!</font><br><br></td>"; $error=1; } elseif ($row['cLevel'] < $reslevel){ echo "<td><br><font size=2><b>$char</b> need level [<b>$reslevel</b>] to Reset!</font><br><br></td>"; $error=1; } elseif ($row['Resets'] >= $maxres) { echo "<td><br><font size=2>You have reach maximum resets! Cannot reset this hero!</font><br><br></td>"; $error=1; } if($error !=1) { $resetup = $row['Resets'] + (1); $money = $row['Money'] - $resmoney; $reset_points = "UPDATE character SET [LevelUpPoint]='$respoints',[Money]='$money',cLevel='1',Experience='0',[MapNumber]='0',[MapPosX]='125',[MapPosY]='128',[Resets]='$resetup' WHERE Name='$char'"; $reset_results = mssql_query($reset_points); echo "<td><br><font size=2><b>$char</b> has been reset!</font><br><br></td>"; } } } ?>
еи ся вече ако не стане
Васе на някои колоната им е AccountID а на други memb___id xD странно xD проверете в MEMB_STAT каква ви е колоната и ако пак има проблем кажете