Hello All,
I am looking for improvements on the below code, the code below is a search box that I need to be able to display either of two ways, one is when there is no $GET['sq'] in the url then it displays it in the center of the screen with the button below and centered as well. When $GET['sq'] exist then it is to the left at the top with the button to the right of the box. I would like to see this one piece of code be able to be used for the three search features that is on the site with the search button changing
Thanks for all the advice and help ahead of time!
Sincerely,
Christopher
<?php
if(empty($_GET['sq'])){echo '<br /><br /><br /><br /><br /><center>';}else{echo '<br />';}
echo '
<div class="'; if(empty($_GET['sq'])){echo 'main_search_box';}else{echo 'result_search_box';} echo '">
';
if(isset($_GET['sq'])){echo "<center>";}
echo '
<form action="index.php" method="get">
<input class="search_box" type="text" name="sq" size="25" value="'; if(isset($_GET['sq'])){echo $_GET['sq'];} echo '"/>'; if(empty($_GET['sq'])){echo '<br />';} echo '
<input type="submit" name="submit" value="Search '.$tab.'" />
</form>
';
if(isset($_GET['sq'])){echo "</center><br />";}
echo '
</div>
';
if(empty($_GET['sq'])){echo '</center>';}
?>