#!/usr/bin/perl #$DIR = "/home3/projects/system"; #use strict; #push @INC, "$DIR/inc"; #require 'parsform.pl'; use LWP::UserAgent; require 'sub.pl'; require 'cgi-lib.pl'; #ReadParse(*FORM); #my $form; #my $title; &parse_form(); #printForm(); $template_file = "first.html"; print "Content-type: text/html\n\n"; # foreach my $key (sort keys %ENV) # { # print "
$key = '$ENV{$key}'
\n" # } # my $txt=TemplateFile('not_found_in_search.html'); # print $txt; #exit; if ($FORM{text} || $ENV{QUERY_STRING}=~/text/ || $ENV{QUERY_STRING}=~/query/){ $ua = LWP::UserAgent->new; # $ua->agent("MyApp/0.1 "); # Create a request my $q = "text=$FORM{text}"; if (exists($FORM{p}) || exists($FORM{oldqs}) ){ $q = $ENV{QUERY_STRING}; my $temp = "qs=licen%3D%25CD%25E5%25E7%25E0%25F0%25E5%25E3%25E8%25F1%25F2%25F0%25E8%25F0%25EE%25E2%25E0%25ED%25ED%25E0%25FF%2B%25EA%25EE%25EF%25E8%25FF%26text"; if (exists($FORM{oldqs})){ my $tmp = "licen%3D%25CD%25E5%25E7%25E0%25F0%25E5%25E3%25E8%25F1%25F2%25F0%25E8%25F0%25EE%25E2%25E0%25ED%25ED%25E0%25FF%2B%25EA%25EE%25EF%25E8%25FF%26"; $q =~ s/oldqs=([^&]+)/oldqs=$tmp$1/; } $q =~ s/query([^&]+)/$temp$1/; } my $req = HTTP::Request->new(GET => "http://honeyweb.ru:17000/?$q"); my $res = $ua->request($req); my $content; if ($res->is_success) { $content = $res->content; } else { $res->status_line; print "Bad luck this time\n"; } # print $content; my $finded = 0; if (index($content, "")!=-1){ my $del = '