Thread Wie PHP-Code in .cgi ausführen?
(39 answers)
Opened by newperler at 2011-04-29 19:19
Auszug aus der Konfigurationsdatei:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 #### You do not have to edit below unless you want to ############################################ $DATABASE_DIR = $KSEARCH_DIR.'database/'; $DATABASEFILE = $DATABASE_DIR.'database.txt'; $F_FILE_DB_FILE = $DATABASE_DIR.'files'; $F_SIZE_DB_FILE = $DATABASE_DIR.'files_size'; $F_DATE_DB_FILE = $DATABASE_DIR.'files_date'; $F_TERMCOUNT_DB_FILE = $DATABASE_DIR.'files_termcount'; $DESCRIPTIONS_DB_FILE = $DATABASE_DIR.'descriptions'; $TITLES_DB_FILE = $DATABASE_DIR.'titles'; $FILENAMES_DB_FILE = $DATABASE_DIR.'filenames'; $TERMS_DB_FILE = $DATABASE_DIR.'terms'; $CONTENTS_DB_FILE = $DATABASE_DIR.'contents'; $ALT_TEXT_DB_FILE = $DATABASE_DIR.'alt_text'; $LINKS_DB_FILE = $DATABASE_DIR.'links'; $META_DESCRIPTION_DB_FILE = $DATABASE_DIR.'meta_description'; $META_KEYWORD_DB_FILE = $DATABASE_DIR.'meta_keyword'; $META_AUTHOR_DB_FILE = $DATABASE_DIR.'meta_author'; $CONFIGURATION_DIR = $KSEARCH_DIR.'configuration/'; $IGNORE_FILES_FILE = $CONFIGURATION_DIR.'ignore_files.txt'; $IGNORE_TERMS_FILE = $CONFIGURATION_DIR.'stop_terms.txt'; $HELP_FILE = $KSEARCH_DIR.'search_tips.html'; $LOG_FILE = $KSEARCH_DIR.'log.txt'; $TEMPLATE_DIR = $KSEARCH_DIR.'templates/'; $KSEARCH_TEMPLATE = $TEMPLATE_DIR.'search.php'; $FORM_LINK = '<a href="#form" alt="To Search Form" title="To Search Form" onclick="document.search.'.$FORM_INPUT_NAME.'.focus()">Form</a>'; $SPEED_TIP_TIME = 5; # time required to get a tip to increase search speed $VERSION = "1.6"; 1; Die ksearch.cgi liegt komplett hier als .txt. Ab Zeile 785 (hier im Auszug Zeile 14) wird es IMHO interssant: Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 sub returnresults { # creates HTML page from template file my %h; my ($options, $sortby, $casesearch, $commonterms, $subsearch_string, $subsearch_info); my $rank = 0; $query_terms_copy =~ s/\s$//; my $bare_query = $query_terms_copy; my $query_str = CGI::escape($bare_query_terms); my $previous_query_str = CGI::escape($previous_query); $bare_query_terms =~ s/\"/\"\;/g; $h{query_str} = $bare_query_terms; $h{version} = $VERSION; $h{search_url} = $SEARCH_URL; $h{input_name} = $FORM_INPUT_NAME; $html = get_template($KSEARCH_TEMPLATE); my $results = @sortedanswers; my $currentpage = $query->param('p'); $currentpage ||= 1; if ($SEARCH_RESULTS && $query->param('pq') !~ /^\s*$/) { $subsearch_string = '&pq='.CGI::escape($query->param('pq')); $subsearch_info = ' im vorherigen Ergebnis'; } |