My search form is not working. It only works when I remove the 'search bar' called 'search' as I also have several drop down menus where users can fetch details from table. I simple added 'search' so users can straight away find specific information. But when I added the 'search' bar, then it doesn't work.
index.php
<form name="formbrwse" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post" enctype="multipart/form-data">
<input type="text" name="search">
<td>
<input type="image" name="searchbtn" id"searchbtn" src="searchbtn.fw.png"
width="166" height="38"></td>
search.php
if(isset($_POST['searchbtn_x'])&&($_POST['searchbtn_x']!='')&&isset($_POST['search'])&&($_POST['search']!='')){
$search=isset($_POST['search'])?$_POST['search']:"";
$search=preg_replace("#[^0-9a-z]i#","",$search);
$category=isset($_POST['category'])?$_POST['category']:"";
$location=isset($_POST['location'])?$_POST['location']:"";
$name_ddasr=isset($_POST['name_ddasr'])?$_POST['name_ddasr']:"";
$opt=isset($_POST['opt'])?$_POST['opt']:"";
//dropdown menu below
if(isset($_POST['category'],$_POST['location'],
$_POST['name_ddasr'],$_POST['opt'])){
if($_POST['search']!=''&&$_POST['category']=='All Categories'&&$_POST['location']
=='Entire Place'&&$_POST['name_ddasr']=='For sale'&&$_POST['opt']=='vrecent'){
//DDmenu comparing ends here
$advert = "SELECT * FROM usertable WHERE adtitle LIKE '%$search%' AND
dcrptn LIKE '%$search%' AND optionsalerent='For sale'";
$result=$conn->query($advert);
}}}