lisaw has asked for the wisdom of the Perl Monks concerning the following question:
exit if $operate==0; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs=split(/&/,$buffer); foreach $pair (@pairs) { ($name, $value)=split(/=/,$pair); $value =~ tr/+/ /; $value=~s/%(..)/pack("c",hex($1))/ge; $f{$name}=$value; chomp($f{$name}); } print "Content-type:text/html\n\n$head $pageadmin $mid\n"; print " <table border=0 width=100% cellspacing=0 cellpadding=1>\n"; print "<tr><td bgcolor=#CCCCCC><b> File Removal System</b></td></ +tr></table>"; if(($f{'action'} eq "delete")&&(open(FILE,$f{'file'}))){ unlink($f{'file'})||print "<h1>Could Not Delete: ".$f{'file'}."</h +1>"; } $dir=$f{'dir'} if $f{'password'} eq $password; opendir(DIR,$dir); @dirfiles=readdir(DIR); closedir(DIR); @dirfiles=sort(@dirfiles); print "<p><center><table border=0 cellpadding=5 cellspacing=0><tr><td> +"; print "<p><center><table border=0><tr><form action=".$ENV{'REQUEST_URI +'}." method=post><td>\n"; print "<input type=hidden name=dir value=\"".$location."\" size=40>\n" +; print "<input type=hidden name=password value=orianphoto size=40></td> +\n"; print "<td rowspan=2><input type=submit value=\"Click Here To View Con +tents Of Directory\"></td></tr>\n"; print "<tr><td><input type=hidden name=password value=orianphoto size= +40></td></form></tr></table></center></p>\n\n"; print "</td></tr><tr><td>\n\n\n"; print "<p><center><table border=1><tr>\n"; print "<form action=".$ENV{'REQUEST_URI'}." method=post>\n"; print "<input type=hidden name=action value=delete>\n"; print "<td bgcolor=navy><font color=white><B>Files in The Photo Direct +ory: </td></tr><tr><td>\n"; $i=0; foreach $file(@dirfiles){ if((!opendir(TEST,$dir."/".$file))&&($f{'password'} eq $password)& +&($file ne ".")&&($file ne "..")){ $i++; print "<input type=checkbox name=file value=\"".$dir."/".$file +; if($i==1){ print "\" checked>"; }else{ print "\">"; } print $file."<BR>\n"; } } print "<input type=hidden name=dir value=\"".$location."\">\n"; print "<input type=hidden name=password value=orianphoto>\n"; print "<input type=submit value=\"Delete Selected File\"></td>\n"; print "</form></tr></table></center></p>"; print "</td></tr></table></center></p>\n"; print "$footer";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: Converting To CGI.PM
by jeffa (Bishop) on Jun 05, 2003 at 14:53 UTC | |
|
Re: Converting To CGI.PM
by LordWeber (Monk) on Jun 05, 2003 at 14:08 UTC | |
|
Re: Converting To CGI.PM
by DamnDirtyApe (Curate) on Jun 05, 2003 at 15:07 UTC | |
|
Re: Converting To CGI.PM
by PodMaster (Abbot) on Jun 06, 2003 at 05:18 UTC |