#!/usr/bin/perl $firstline = "### Do not change this line ### 063019710830 ###\n"; $fsize = "\"2\""; # font size # get filename and access type as query_string seperated by a + sign # access type "form" denates form access, otherwise applet access # in applet access, this script sends out the file as txt line by line $filename = $ENV{'QUERY_STRING'}; if (open(F, "$filename")) { # file should exist beforehand, security precaution if ($firstline eq ) { print "Content-type: text/html\n\n"; # if request_method is POST then we are run from the form generated # by the previous run of this script # The initial run of this script is by a GET method # (i.e., just by typing the url to the script with # filename+accesstype ) if((uc "$ENV{'REQUEST_METHOD'}") eq "POST") { close F; # close for reading $len = $ENV{'CONTENT_LENGTH'}; # get keys/values if (($got = read(STDIN, $in, $len) != $len)) { print "$got < $len
\n"; exit; } @in = split(/[&;]/,$in); foreach $i (0 .. $#in) { # Convert plus to space $in[$i] =~ s/\+/ /g; # Split into key and value. ($key, $val) = split(/=/,$in[$i],2); #split on the first =. # Convert %XX from hex numbers to alphanumeric $key =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($1))/ge; $val =~ s/%([A-Fa-f0-9]{2})/pack("c",hex($1))/ge; # Associate key and value $in{$key} .= "\0" if (defined($in{$key})); $in{$key} .= $val; } # write received info to the file $cnt = 0; while (defined($in{"url$cnt"})) {$cnt = $cnt + 1;} open(FF, ">$filename"); # open for writing print FF $firstline; foreach $i (0 .. ($cnt - 1)) { $line[$i] = "$in{qq/src$i/}|$in{qq/tit$i/}|$in{qq/url$i/}\n"; if (!defined($in{"del$i"})) { $tt = $in{"tit$i"}; $tt =~ tr/ \t\n\r\f\b//d; if (length $tt) { print FF "$line[$i]"; } } } close FF; # close for writing open(F, "$filename"); # open for reading ; # read the firstline } # read the file and display info as a form print "
\n"; print "



\n"; $i = 0; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; while () { chomp; ($src, $tit, $url) = split(/\|/); print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; $i = $i + 1; } print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Java Haber Appleti Güncelleme Formu
SilinizHaber KaynağıHaber BaşlığıHaber URL
\n"; print "
\n"; print "
\n"; } else { # wrong file print "Content-type: text/html\n\n"; print "



Not a valid news file..."; } close F; } else { # file was not found, could not be opened, etc... print "Content-type: text/html\n\n"; print "



Dosya Bulunamadi..."; } exit;