php 소스시 mssql 체크 실패

php 소스시 mssql 체크 실패

QA

php 소스시 mssql 체크 실패

본문

 

if (substr($_item,0,2)=='0x') 
$_item = substr($_item,2);

if ((strlen($_item)!=32) || (!ereg("(^[a-zA-Z0-9])",$_item)) || ($_item == 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'))
return false;
// Get the hex contents
$sy = hexdec(substr($_item,0,2)); // Item ID
$iop = hexdec(substr($_item,2,2)); // Item Level/Skill/Option Data
$itemdur= hexdec(substr($_item,4,2)); // Item Durability
$serial = substr($_item,6,8); // Item SKey
$ioo = hexdec(substr($_item,14,2)); // Item Excellent Info/ Option
$ac = hexdec(substr($_item,16,2)); // Ancient data
$itt = hexdec(substr($_item,18,2)); // Item Type
$output['itt'] = substr($_item,18,2);
============================================================
if (strlen($_GET['item_serial'])==8) {
if ($result=mssql_fetch_row(mssql_query("select [Name] from [Character] where (charindex (0x".$_GET['item_serial'].", Inventory) %16=4)"))) 
print 'That item has been found in character <b>'.$result[0].'</b>\'s inventory!';
elseif($result=mssql_fetch_row(mssql_query("select [AccountId] from [warehouse] where (charindex (0x".$_GET['item_serial'].", Items) %16=4)"))) 
print 'That item has been found in account <b>'.$result[0].'</b>\'s personal storage!';
===========================================================
if (strlen($_GET['serial'])!=8) {
print '잘못된아이템임니다';
break;
}


$query = mssql_query("select [AccountId] from [warehouse] where (charindex (0x".$_GET['serial'].", Items) %16=4)");
$rez = mssql_fetch_row($query);
if ($rez[0]!=$GLOBALS['mu_user']) {
print '판매불가능!';
break;
}
==========================================================

위에 소스에서
빨간색부분중 아이템 시리얼  부분을
$serial = substr($_item,6,8); // Item SKey
if (strlen($_GET['item_serial'])==8) 
if (strlen($_GET['serial'])!=8) {


$serial = substr($_item,14,10); // Item SKey
if (strlen($_GET['item_serial'])==10) 
if (strlen($_GET['serial'])!=10) {

이렇게 수정했더니
녹색 부분이 계속  판매 불가능 으로 나옴니다.

수정전에는 판매 불가능없이 바로 판매가 되었습니다.
수정하니 판매불가능으로 잡히는데
(0x".$_GET['serial'].", Items) %16=4)"); 이부분을 수정해야 하나요 ?

이 질문에 댓글 쓰기 :

답변 1

먼저 쿼리가 정상인지 확인하세요

"select [AccountId] from [warehouse] where (charindex (0x".$_GET['serial'].", Items) %16=4)" 

그리고 $rez에 값 도 정상인지 확인하시구요

답변을 작성하시기 전에 로그인 해주세요.
전체 76
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT