테스트 사이트 - 개발 중인 베타 버전입니다

php 소스시 mssql 체크 실패 채택완료

그누랑놀자 8년 전 조회 3,416

 

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 '.$result[0].'\'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 '.$result[0].'\'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개

채택된 답변
+20 포인트

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

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

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

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

그누랑놀자
8년 전
네 정상적입니다.빨간색 수정전에는 잘 잘동되고있습니다.

빨간색을 변경했더니 시리얼 체크가 안되고 있습니다.

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인