<script>
function SearchCheckForm(f){
if( f.keyword.value == ""){
alert("검색창에 아티스트나 곡명을 입력해주세요.");
f.keyword.focus();
return false;
}
}
</script>
<form action="/ezmart.php" name="SearchCheck" method = "get" onsubmit='return SearchCheckForm(this);' >
<input type = "hidden" name="tquery" value="martmain">
<table width="540" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="228"><img src="/01_img/main/search.gif" width="228" height="34" /></td>
<td background="/01_img/main/search-02.gif" width="261" height="34" class="txtLeft"><input name="keyword" type="text" style="margin:5px 8px 5px 8px; padding:1px; border:none; height:16px; width:238px;" value="<?=urldecode(stripslashes($keyword))?>" /></td>
<td align="right" valign="middle"><input type = "image" src="/01_img/main/search-03.gif" width="51" height="34" /></td>
</tr>
</table>
</form>

<?

/*
DB에서의 저장은
1) '
2) &#039;

2가지로 되어 있는 싱태 이다

ex)

Don\&#039;t Cry (원음 MR)
Don\&#039;t Say Goodbye (MR)
Don\'t Cry (로열패밀리 OST)

*/

// 홑따움표를 변환 시킨다.
if($keyword){
$tkeyword = strip_tags(trim(urldecode(stripslashes($keyword))));
$tkeyword = str_replace(' ' , '' , $tkeyword);
$tkeyword = preg_replace("/\'/", "", $tkeyword);
$tkeyword = preg_replace("/\&#039;/", "", $tkeyword);

$where .= " and ( " ;
$where .= " ( REPLACE(Name,' ','') LIKE '%$tkeyword%' OR REPLACE(Model,' ','') LIKE '%$tkeyword%' ) ";
$where .= " or ( REPLACE( Name, '\\\\&#039;', '' ) LIKE '%$tkeyword%' OR REPLACE( Model, '\\\\&#039;', '' ) LIKE '%$tkeyword%' ) ";
$where .= " or ( REPLACE( Name, '\\\\\\'', '' ) LIKE '%$tkeyword%' OR REPLACE( Model, '\\\\\\'', '' ) LIKE '%$tkeyword%' ) ";

$where .= " ) ";
}

?>

<?
$TransData = "tquery=$tquery&code=$code&keyword=" . urlencode(stripslashes($keyword));
include "${SKIN_FOLDER_NAME}/page/${PageSkin}/index.php" ;
?>

2012/02/07 10:07 2012/02/07 10:07

Trackback Address :: 이 글에는 트랙백을 보낼 수 없습니다