Debbie helped me to get the code to work correctly with Dadabik 4.2. The correct code that needs to be pasted into the bottom of header.php file is posted below. However there is still one last problem. For some reason if I search in any other language besides English then the search crashes with an error. It seems that the foreign language (in my case Hebrew, but I tried it with other characters as well) characters do not get encoded correctly. However the main search in Dadabik works fine with other languages on the same database. If anyone can help with this I would appreciate it.
<?php
if ($_GET["function"] != "show_search_form") { //this if statement prevents the Quick Search form to show up on the Advanced Search page
?>
<?php
// query to get the fields names to include in the search - specify which types in the where clause
// remove the where part of the sql line if you want to include ALL your fields
$sqlcols = "SELECT name_field FROM ".$prefix_internal_table.$table_name." WHERE type_field IN ('text','textarea','rich_editor')";
//This line searches only specific fields in the database that are specifide by the field name. To use it Uncomment it and comment the line above. Change the fields names to the names in your database.
//$sqlcols = "SELECT name_field FROM ".$prefix_internal_table.$table_name." WHERE name_field IN ('author_english','author_hebrew','title_english,'title_hebrew')";
//This line searches all fields.
//$sqlcols = "SELECT name_field FROM ".$prefix_internal_table.$table_name."";
$searchall = execute_db($sqlcols, $conn);
// as long as column names are found meeting criteria above, construct form fields
while ($searchfield = fetch_row_db($searchall)){
// This line not required -- used to get list of column names into array that can be printed to screen to verify columns it has found
$allfields .= $searchfield[0].' ';
// sets the search select type to 'contains' for each column included in search request
$allseltypes .= '<input name="'.$searchfield[0].$select_type_select_suffix.'" type="hidden" value="contains">';
// creates a hidden form field for each column included in search request
$fieldterm .= '<input name="'.$searchfield[0].'" type="hidden" value="">';
// writes onSubmit values to form open tag to set the value for each hidden field defined above
$submitline .= 'document.searchall.'.$searchfield[0].'.value = document.searchall.allterm.value;';
} // end while column names are found
// uncomment to display database table columns found which will be included in search form
echo '<pre>';
print_r($allfields);
echo '</pre>';
?>
<form name="searchall" class="noformpad" style="padding-bottom:5px;" method="POST" action="<?php echo $dadabik_main_file; ?>?table_name=<?php echo urlencode($table_name); ?>&page=0&function=search&execute_search=1" enctype="multipart/form-data" accept-charset="Windows-1255" onSubmit="javascript:<?php echo $submitline; ?>return true;">
Quick Search:
<input type="hidden" name="operator" value="or">
<?php echo $allseltypes; ?>
<input name="allterm" type="text" size="10" maxlength="100">
<?php echo $fieldterm; ?>
<input type="submit" value="<?php echo $submit_buttons_ar["search_short"]; ?>" class="submit">
</form>
<?php
} //closing bracket for the if ($_GET["function"] != "show_search_form")
?>