php - Search Keyword and Code from one search -
Currently, I have 2 search boxes, one for another product code for the keyword.
I only have 1 search box but the user is allowed to search both the keyword and the code. \
My search Php file currently has:
if (isset ($ counter)) {for ($ r = 1; $ r <$ count; $ r ++) {$ Division_breadcrumb = $ Filter [$ r] ["div"]. $ Filter [$ r] ["cats"]. & Lt; P class = "clear" & gt; & Lt; / P & gt; '; Mysql_free_result ($ QUERY2); Not set (get $ _ ['division2'], $ data2); }} // code or keyword is used} elseif (isset ($ _ POST ['keyword']) || isset ($ _ POST ['code'])) {$ keyword = NULL; If (isset ($ _ POST ['keyword'])) {if ($ _ POST ['keyword']! = 'Keyword' & $ _POST ['keyword']! = '') {If (strpos ( $ _POST ['keyword'], ''! == incorrect) {$ _POST ['keyword'] = str_replace ('', '+', $ _ POST ['keyword']); If ((strops ($ _ POST ['keyword'], 's') == incorrect) & amp; amp; and (strops ($ _ POST [' keyword '],' ss) === incorrect)) $ _POST ['keyword'] = str_replace ('s', '', $ _ POST ['keyword']); If (substr ($ _ POST ['keyword'], strangel ($ _ POST ['keyword']) - 1) 's' $$ _POST ['keyword'] = substr ($ _ POST ['keyword' ], 0, (strlen ($ _ post ['keyword']) - 1)); $ keyword = 'and match (WEB_InventTable.ItemName, WEB_InventTable.Range, WEB_InventTable.Description) ("+'. $ _ POST ['Keyword']. '' In boolean mode ';} other {if (substr ($ _ POST [' keyword '], strlen ($ _ POST [' keyword ']) - 1) ==' s') $ _POST ['keyword'] = substr ($ _ POST ['keyword'], 0, (strlen ($ _ post ['keyword']) - 1)); $ keyword = 'AND (item name "%' . $ _ POST ['keyword']. 'Item name' as'% "or". $ _ POST ['keyword']. Item name like '%' or 'name'. $ _ POST ['keyword'] . ' '$' ($ _ POST ['keyword'] == 'keyword') {$ _POST ['keyword'] = null;}} $ Code = NULL; If (isset ($ _ POST ['code '])) {If ($ _ POST [' code ']! =' Code '& $ _POST [' code ']! =' '& Amp; Amp; amp; and $ _POST [' code ']! =' Code ') {$ code =' and 'item' like '%'. $ _ POST ['code']. '%' ';} If ($ _ POST [' code '] ==' code ') {$ _POST ['Code'] = null; }} $ Link = 'page = search & amp; Amp; Amp; Keyword = '. $ _ POST ['keyword'] '& Amp; Amp; Code = '. $ _ POST ['code'];
Comments
Post a Comment