Drigendes Problem

Irgendwelche Probleme mit XAMPP für Windows? Dann ist hier genau der richtige Ort um nachzufragen.

Drigendes Problem

Postby hotwin » 09. May 2006 22:09

Was habe ich falsch gemacht ?
Ich nutze XAMPP Windows 1.5.2 mit Perl 5.8.7-2.2.0-pl3

Mein Problem ist das XAMPP zu kurz läd
wie kann ich das ändern ? (Demo Link Verzeichnis)

Läuft über Php und MY QSL
http://boettcher.faked.us/verzeichnis

Mein Problem ist das
Wenn ich auf eine suche klicke kommen keine ergebnisse wo kann der fehler sein

Läuft über cgi und Perl
http://boettcher.faked.us/



Benötiege dringend hielfe
Danke im Voraus
Hotwin
User avatar
hotwin
 
Posts: 59
Joined: 23. June 2004 20:55
Location: berlin

Postby max_payne » 10. May 2006 06:22

quellcode wäre nicht schlecht!
max_payne
 
Posts: 10
Joined: 07. May 2006 20:56

Postby hotwin » 10. May 2006 06:47

Ok fangen wie mir der suchmaschine an
ist .pl und läst sich nicht ausführen
Läuft über cgi und Perl
http://boettcher.faked.us/


Code: Select all
#!D:\server\xampp\perl\bin\perl.exe
###################################################
#
# MetaSearch (basic version)
#                   
#
#
#
# Free version
# Modifications in templates are allowed
#
# Version 1.0 (8/1/2001) Google (2 parse)
#
# meta26.cgi?search=web&query=(search term)
#
# For metasearch updating, simply upload new *.pl files in ASCII mode.
#######################################################

#startup module
$select=qq~<select name="search" size="1"><option value="web">The Web</option>~; #No </select> !!!!
%in=&parse;
#End of startup

sub main{

$select.="</select>";


#Reserved ?search=web (default)

$kwd=$in{'query'};

#Encode the query string.


if (!$kwd) {print &load_template("metasearch_error8.html",{ message => "Please enter search term!", query => $kwd, select => $select});exit;}
#Detecting page which need to show

$page=$in{'start'};
if (!$page) {$page=1;}
$page--;
$page=$page*$results;

$kwd1=$kwd; $kwd=~ s/ /+/g;
$kwd1=~ s/([^\$])/uc sprintf("%%%02x",ord($1))/eg;

$url="http://www.google.de/search?q=$kwd1&hl=en&safe=off&start=$page&sa=N&num=$results";


#Fetching content.

$html = fetch($url);

#Checking for correct format

#Google rotate formats of search results for preventing metasearch
#we at first trying detect current format
#<A class=k (first format)

$format=0;

if ($html=~ /class\=k/is) {$format=1;}

if ($html =~ m#did not match any documents#is) {print &load_template("metasearch_error8.html",{ message => "Not found in database", query => $kwd, select => $select});exit;}

$html=~ m#Results <b>(.*?) \- (.*?)</b> of about <b>(.*?)</b>\.#is;
$total=$3;
#Now we know - how much results google found. But we will be limit to $results search bar

#Remove <b></b><br>

$html=~ s/<b>//gis;
$html=~ s/<\/b>//gis;
$html=~ s/<br>//gis;

#Parsing returned html.

$how=0;
$links="";

if ($parser ==1) {
while ($html =~ m#<p><A class=k HREF\=(.*?)>(.*?)<\/A>(.*?)<span#gsi) {

$url1=$1;
$title=$2;
$descr=$3;
$descr=~ s/<font(.*?)>//gis;
$descr=~ s/<br>//gis;
$descr=~ s/<b>//gis;
$descr=~ s/<\/b>//gis;
$descr=~ s/<\/font>//gis;
$descr=~ s/<a(.*?)<\/a>//gis;
$descr=~ s/Category\://gis;
$pg=$page+$how+1;

$links.= &loadtemplate("web_link8.html", {
                  url => $url1,
                  title => $title,
                  descr => $descr,
                  id    => $pg
               });

$how++;
}
}

if ($parser ==0) {
while ($html =~ m#<p><A HREF\=(.*?)>(.*?)<\/A>(.*?)<font c#gsi) {

$url1=$1;
$title=$2;
$descr=$3;

$descr=~ s/<font(.*?)>//gis;
$descr=~ s/<\/font>//gis;
$descr=~ s/<br>//gis;
$descr=~ s/<b>//gis;
$descr=~ s/<\/b>//gis;
$descr=~ s/<a(.*?)<\/a>//gis;
$descr=~ s/Category\://gis;
$pg=$page+$how+1;

$links.= &loadtemplate("web_link8.html", {
                  url => $url1,
                  title => $title,
                  descr => $descr,
                  id    => $pg
               });

$how++;
}
}


if ($how == 0) {print &load_template("metasearch_error8.html",{ message => "No results", query => $kwd, select => $select});exit;}

#Generation of navigation table & search_results page

#Navigation page

$total=~ s/\,//g;

$navhtml=html_navbar($results,$total,$page,"$scriptname?search=web&query=$kwd1&");

#Ok. All generated. Now return output


print &load_template("metasearch_results8.html", {
                  search_results => $links,
                  total => $total,
                  query => $kwd,
                  next => $navhtml,
                  page => $cpage,
                  select => $select
                                                });
exit;

}

#Main subroutines
sub load_template{my ($filename,$text,%values,$name,$value);$filename=shift;$name=shift;%values=%$name;$text="";open(IN,"<$filename") or error("Cannot open $filename : Reason $!");while(<IN>){chomp;$text.=$_;}close IN;while(($name,$value)=each %{values}){$value=$values{$name};$text =~ s/<\%$name\%>/$value/g;}if (!$registered) {$logo = qq~~;if ($text !~/mycgiscripts\.com/i) {$text=~ s/<\/body>/$logo/is;}}return $text;}
sub loadtemplate{my ($filename,$text,%values,$name,$value);$filename=shift;$name=shift;%values=%$name;$text="";open(IN,"<$filename") or error("Cannot open $filename : Reason $!");while(<IN>){chomp;$text.=$_;}close IN;while($text =~ m/\<\%(.*?)\%\>/gsi) {$name=$1;if (exists($values{$name})) {$value=$values{$name};}else{$value="";}$text =~ s/<\%$name\%>/$value/g;}return $text;}
sub error{$mes=shift;print qq~<html><font face="Verdana" size="2"><center><b>Error</b> : $mes<br><br><a href="javascript:history.go(-1)">Back~;exit;}
sub fetch{my ($url) = @_;my $page_returned = "";use LWP::UserAgent;$ua = new LWP::UserAgent;$ua->timeout($timeout);$ua->agent('Mozilla/4.0');my $req = new HTTP::Request GET => "$url";my $res = $ua->request($req);if ($res->is_success) { $page_returned = $res->content; }   return $page_returned;}
sub parse{my (@pairs, %in);my (@pairs, %in);my ($buffer, $pair, $name, $value);if ($ENV{'REQUEST_METHOD'} eq 'GET') {@pairs = split(/&/, $ENV{'QUERY_STRING'});}elsif($ENV{'REQUEST_METHOD'} eq 'POST') {read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});@pairs = split(/&/, $buffer);}PAIR: foreach $pair (@pairs) {($name, $value) = split(/=/, $pair);$name =~ tr/+/ /;$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;$value =~ tr/+/ /;$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;($value eq "---") and next PAIR;exists $in{$name} ? ($in{$name} .= "~~$value") : ($in{$name}  = $value);}return %in;}
sub html_navbar{my ($maxhits,$current,$numhits,$url)=0;my ($html, $nh, $prev_hit, $next_hit, $left, $right, $first, $last, $lower, $upper)="";$maxhits  =shift; $numhits  =shift; $current  =shift; $url      =shift; $nh=int($current/$maxhits)+1;  $prev_hit=$nh-1;       $next_hit=$nh+1;       if (($current + $maxhits) >= $numhits) {$next_hit=0;}if ($numhits > $maxhits) {          $left  = $nh; $right = int($numhits/$maxhits) - $nh;                ($left > 7)  ? ($lower = $left - 7) : ($lower = 1);        ($right > 7) ? ($upper = $nh + 7)   : ($upper = int($numhits/$maxhits) + 1);        (7 - $nh >= 0) and ($upper = $upper + (8 - $nh));        ($nh > ($numhits/$maxhits - 7)) and ($lower = $lower - ($nh - int($numhits/$maxhits - 7) - 1));        $html = "";        ($nh > 1) and ($html .= qq~<a href="$url&start=$prev_hit">[<<]</a> ~);        for ($i = 1; $i <= int($numhits/$maxhits) + 1; $i++) {            if ($i < $lower) { $html .= " ... "; $i = ($lower-1); next; }                       if ($i > $upper) { $html .= " ... "; last; }            ($i == $nh) ?                ($html .= qq~$i ~) :                ($html .= qq~<a href="$url&start=$i">$i</a> ~);            (($i * $maxhits) >= $numhits) and last;       }if ($next_hit) {        $html .= qq~<a href="$url&start=$next_hit">[>>]</a> ~ unless ($nh == $i);      }            }return $html;}   
1;



Code: Select all
#!D:\server\xampp\perl\bin\perl.exe
##################################################
#
# MetaSearch (basic version)
#                   
#
#
#
# Free version
# Modifications in templates are allowed
#
# Version 1.0 (8/1/2001) Google (2 parse)
#
# meta25.cgi?search=web&query=(search term)
#
# For metasearch updating, simply upload new *.pl files in ASCII mode.
#######################################################

#startup module
$select=qq~<select name="search" size="1"><option value="web">The Web</option>~; #No </select> !!!!
%in=&parse;
#End of startup

sub main{

$select.="</select>";


#Reserved ?search=web (default)

$kwd=$in{'query'};

#Encode the query string.


if (!$kwd) {print &load_template("metasearch_error8.html",{ message => "Please enter search term!", query => $kwd, select => $select});exit;}
#Detecting page which need to show

$page=$in{'start'};
if (!$page) {$page=1;}
$page--;
$page=$page*$results;

$kwd1=$kwd; $kwd=~ s/ /+/g;
$kwd1=~ s/([^\$])/uc sprintf("%%%02x",ord($1))/eg;

$url="http://www.google.de/search?q=$kwd1&hl=en&safe=off&start=$page&sa=N&num=$results&meta=lr%3Dlang_de";


#Fetching content.

$html = fetch($url);

#Checking for correct format

#Google rotate formats of search results for preventing metasearch
#we at first trying detect current format
#<A class=k (first format)

$format=0;

if ($html=~ /class\=k/is) {$format=1;}

if ($html =~ m#did not match any documents#is) {print &load_template("metasearch_error8.html",{ message => "Not found in database", query => $kwd, select => $select});exit;}

$html=~ m#Results <b>(.*?) \- (.*?)</b> of about <b>(.*?)</b>\.#is;
$total=$3;
#Now we know - how much results google found. But we will be limit to $results search bar

#Remove <b></b><br>

$html=~ s/<b>//gis;
$html=~ s/<\/b>//gis;
$html=~ s/<br>//gis;

#Parsing returned html.

$how=0;
$links="";

if ($parser ==1) {
while ($html =~ m#<p><A class=k HREF\=(.*?)>(.*?)<\/A>(.*?)<span#gsi) {

$url1=$1;
$title=$2;
$descr=$3;
$descr=~ s/<font(.*?)>//gis;
$descr=~ s/<br>//gis;
$descr=~ s/<b>//gis;
$descr=~ s/<\/b>//gis;
$descr=~ s/<\/font>//gis;
$descr=~ s/<a(.*?)<\/a>//gis;
$descr=~ s/Category\://gis;
$pg=$page+$how+1;

$links.= &loadtemplate("web_link8.html", {
                  url => $url1,
                  title => $title,
                  descr => $descr,
                  id    => $pg
               });

$how++;
}
}

if ($parser ==0) {
while ($html =~ m#<p><A HREF\=(.*?)>(.*?)<\/A>(.*?)<font c#gsi) {

$url1=$1;
$title=$2;
$descr=$3;

$descr=~ s/<font(.*?)>//gis;
$descr=~ s/<\/font>//gis;
$descr=~ s/<br>//gis;
$descr=~ s/<b>//gis;
$descr=~ s/<\/b>//gis;
$descr=~ s/<a(.*?)<\/a>//gis;
$descr=~ s/Category\://gis;
$pg=$page+$how+1;

$links.= &loadtemplate("web_link8.html", {
                  url => $url1,
                  title => $title,
                  descr => $descr,
                  id    => $pg
               });

$how++;
}
}


if ($how == 0) {print &load_template("metasearch_error8.html",{ message => "No results", query => $kwd, select => $select});exit;}

#Generation of navigation table & search_results page

#Navigation page

$total=~ s/\,//g;

$navhtml=html_navbar($results,$total,$page,"$scriptname?search=web&query=$kwd1&search");

#Ok. All generated. Now return output


print &load_template("metasearch_results8.html", {
                  search_results => $links,
                  total => $total,
                  query => $kwd,
                  next => $navhtml,
                  page => $cpage,
                  select => $select
                                                });
exit;

}

#Main subroutines
sub load_template{my ($filename,$text,%values,$name,$value);$filename=shift;$name=shift;%values=%$name;$text="";open(IN,"<$filename") or error("Cannot open $filename : Reason $!");while(<IN>){chomp;$text.=$_;}close IN;while(($name,$value)=each %{values}){$value=$values{$name};$text =~ s/<\%$name\%>/$value/g;}if (!$registered) {$logo = qq~~;if ($text !~/mycgiscripts\.com/i) {$text=~ s/<\/body>/$logo/is;}}return $text;}
sub loadtemplate{my ($filename,$text,%values,$name,$value);$filename=shift;$name=shift;%values=%$name;$text="";open(IN,"<$filename") or error("Cannot open $filename : Reason $!");while(<IN>){chomp;$text.=$_;}close IN;while($text =~ m/\<\%(.*?)\%\>/gsi) {$name=$1;if (exists($values{$name})) {$value=$values{$name};}else{$value="";}$text =~ s/<\%$name\%>/$value/g;}return $text;}
sub error{$mes=shift;print qq~<html><font face="Verdana" size="2"><center><b>Error</b> : $mes<br><br><a href="javascript:history.go(-1)">Back~;exit;}
sub fetch{my ($url) = @_;my $page_returned = "";use LWP::UserAgent;$ua = new LWP::UserAgent;$ua->timeout($timeout);$ua->agent('Mozilla/4.0');my $req = new HTTP::Request GET => "$url";my $res = $ua->request($req);if ($res->is_success) { $page_returned = $res->content; }   return $page_returned;}
sub parse{my (@pairs, %in);my (@pairs, %in);my ($buffer, $pair, $name, $value);if ($ENV{'REQUEST_METHOD'} eq 'GET') {@pairs = split(/&/, $ENV{'QUERY_STRING'});}elsif($ENV{'REQUEST_METHOD'} eq 'POST') {read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});@pairs = split(/&/, $buffer);}PAIR: foreach $pair (@pairs) {($name, $value) = split(/=/, $pair);$name =~ tr/+/ /;$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;$value =~ tr/+/ /;$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;($value eq "---") and next PAIR;exists $in{$name} ? ($in{$name} .= "~~$value") : ($in{$name}  = $value);}return %in;}
sub html_navbar{my ($maxhits,$current,$numhits,$url)=0;my ($html, $nh, $prev_hit, $next_hit, $left, $right, $first, $last, $lower, $upper)="";$maxhits  =shift; $numhits  =shift; $current  =shift; $url      =shift; $nh=int($current/$maxhits)+1;  $prev_hit=$nh-1;       $next_hit=$nh+1;       if (($current + $maxhits) >= $numhits) {$next_hit=0;}if ($numhits > $maxhits) {          $left  = $nh; $right = int($numhits/$maxhits) - $nh;                ($left > 7)  ? ($lower = $left - 7) : ($lower = 1);        ($right > 7) ? ($upper = $nh + 7)   : ($upper = int($numhits/$maxhits) + 1);        (7 - $nh >= 0) and ($upper = $upper + (8 - $nh));        ($nh > ($numhits/$maxhits - 7)) and ($lower = $lower - ($nh - int($numhits/$maxhits - 7) - 1));        $html = "";        ($nh > 1) and ($html .= qq~<a href="$url&start=$prev_hit">[<<]</a> ~);        for ($i = 1; $i <= int($numhits/$maxhits) + 1; $i++) {            if ($i < $lower) { $html .= " ... "; $i = ($lower-1); next; }                       if ($i > $upper) { $html .= " ... "; last; }            ($i == $nh) ?                ($html .= qq~$i ~) :                ($html .= qq~<a href="$url&start=$i">$i</a> ~);            (($i * $maxhits) >= $numhits) and last;       }if ($next_hit) {        $html .= qq~<a href="$url&start=$next_hit">[>>]</a> ~ unless ($nh == $i);      }            }return $html;}   
1;
Last edited by hotwin on 10. May 2006 21:17, edited 1 time in total.
User avatar
hotwin
 
Posts: 59
Joined: 23. June 2004 20:55
Location: berlin

Postby deepsurfer » 10. May 2006 10:13

Diese scripte können so nicht vom PERL-Interpreter angesprochen werden da in beiden Scripten die allererste ZEILE fehlt die für eine Benutzung via Webinterface-Aufruf nötig ist.

http://de.selfhtml.org/perl/intro.htm#testen
Erläuterung lesen !
chirio Deep
Wie sagte einst der MCP aus Tron auf dem Bildschirm zu schreiben Pflegte
" ... end of communication ... "
User avatar
deepsurfer
AF Moderator
 
Posts: 6440
Joined: 23. November 2004 10:44
Location: Cologne
Operating System: Win-XP / Win7 / Linux -Debian

Postby hotwin » 10. May 2006 20:44

hab ich gemacht geht leider immer nich nicht :cry: :cry: :cry:
User avatar
hotwin
 
Posts: 59
Joined: 23. June 2004 20:55
Location: berlin


Return to XAMPP für Windows

Who is online

Users browsing this forum: No registered users and 9 guests