0 ){ exit; } #################################### if( !isset( $gl_search_box_width ) ){ $gl_search_box_width = 20; }; if( !isset( $gl_search_box_text_width ) ){ $gl_search_box_text_width = 20; }; if( !isset( $gl_search_button_text ) ){ $gl_search_button_text = 20; }; import_request_variables( "gpc", "in_" ); if( !isset( $in_search_string ) ){ $in_search_string = ""; } ?>
">
" size="" name="search_string" value="" /> " />

Searching powered by SimpleSearch.
Search Results

"; print "\n\n"; $input = fopen( "$gl_data_file", "r" ); if( !input ){ print "Could not open input file."; exit; } # Print heading line if( $gl_first_line_headings == true ){ $line = fgets( $input, $gl_data_max_line_len ); present_line( $line, "ssearch_heading", null ); } if( !isset( $in_search_string ) or strlen( $in_search_string ) == 0 ){ print "\n
\n"; return; } if( !search_string_allowed( $in_search_string ) ){ print "

Your search string is invalid.

"; print "\n\n"; return; } while( $line = fgets( $input, $gl_data_max_line_len ) ){ if( stristr( $line, $in_search_string ) ){ $count++; present_line( $line, "ssearch", "_color".($count%2+1) ); } if( $count == $gl_results_limit ){ break; } } fclose( $input ); print "\n\n"; if( $count == $gl_results_limit ){ print "

The maximum number of results has been reached.

"; } elseif( $count == 0 ){ print "

None

"; } } function search_string_allowed( $string ) { if( strlen( $string ) < 2 ){ return false; } if( !preg_match( "/[A-Za-z0-9]/", $string ) ){ return false; } return true; } function present_line( $line, $style, $color ) { $tr_style = $style; if( isset( $color ) ){ $tr_style = "$style$color"; } print "\n\n"; print ""; foreach( split_line( $line ) as $field ){ print "\n

$field

\n"; } print "\n\n"; } function split_line( $line ) { global $gl_data_format; if( $gl_data_format == "tsv" ){ return split( "\t", $line ); } } ?>