2){ $_SESSION['ses_keyword']=$keyword; } else{ $msg_err="SEARCH ERROR: Please enter an word with at least 3 letters!"; } } } $_SESSION['ses_keyword']=str_replace("-"," ",$_SESSION['ses_keyword']); //if($_SERVER['REMOTE_ADDR']=="89.136.150.242") //echo $_SESSION['ses_keyword']; if(!empty($_SESSION['ses_keyword'])) $sql_where="and ( upper(pages.seo_link) regexp upper('".$_SESSION['ses_keyword']."'))"; // or upper(pages.description) regexp upper('".$_SESSION['ses_keyword']."') or upper(pages.tags) regexp upper('".$_SESSION['ses_keyword']."') //--- //company details $page_limit=15; if(is_numeric($_GET['pag']) and $_GET['pag']>=1){ $pag=$_GET['pag']; } else{ $pag="1"; } $limit=$pag*$page_limit - $page_limit; //--- $query="select pages.*, subcat.name as subcat_name, subcat.seo_link as subcat_seo_link,cat.name as cat_name, cat.seo_link as cat_seo_link from pages left join categories as subcat on subcat.id=pages.id_parent left join categories as cat on cat.id=pages.CatID where pages.visible='yes' $sql_where order by pages.id desc limit $limit,$page_limit "; /* $query="select * from pages where pages.visible='yes' $sql_where order by pages.id desc limit $limit,$page_limit "; */ $articles=sql_show_data($query); //nr inreg $query_limit=substr($query,0,strpos($query,"limit")); $result_limit=mysql_query($query_limit); $nr_inreg=mysql_num_rows($result_limit); //--- if($nr_inreg>1){ $link_to_page="search-article-category-xxpagxx/all-articles/".html($_SESSION['ses_keyword']).".html"; $pagging_article=paging1($nr_inreg,$page_limit, $pag, $link_to_page,$a_name); } if(!empty($articles[0][title]) and ( !empty($_POST['submit_form']) or !empty($_GET['tag']))){ $sql="select id from searches where seo_link='".html($_SESSION['ses_keyword'])."'"; $result=sql_show_data($sql); if(empty($result[0][id])){ $query="insert into searches set name='".$_SESSION['ses_keyword']."', id_parent='$seo_link', seo_link='".html($_SESSION['ses_keyword'])."', data=now();"; mysql_query($query) or die(mysql_error()); } } $cat_seo_link=$seo_link; $seo_title=ucfirst($_SESSION['ses_keyword']); $seo_keywords=$_SESSION['ses_keyword']; $seo_description=$_SESSION['ses_keyword']; $h1_top=$_SESSION['ses_keyword']; $breadcrumb=$_SESSION['ses_keyword']; if (! defined('ANTIHACK')) { die("Nu aveti voie"); } include_once('tpl/search.php'); ?>