12monkey has asked for the wisdom of the Perl Monks concerning the following question:
if i want modify a post message($sign_message)only,#!/usr/bin/perl print "content-type:text/html\n\n"; $admin ="sonic"; if($ENV{'REQUEST_METHOD'} eq "POST"){ read(STDIN,$buffer,$ENV{'CONTENT_LENGTH'}); }else{ $buffer=$ENV{'QUERY_STRING'}; } @pairs=split(/&/,$buffer); foreach $pair(@pairs){ ($name,$value)=split(/=/,$pair); $value=~tr/+/ /; $value=~s/%([0-9a-fA-F][0-9a-fA-F])/pack("C",hex($1))/eg; $value=~s/</</g; $value=~s/\n/<br>/g; $FORM{$name}=$value; } open(READ,"guestbook.dat"); @lines=<READ>; close(READ); my $pw = $FORM{'password'}; my $adminmsg = $FORM{'ownermsg'}; my $modnum = $FORM{'postid'}; if ( $admin eq $pw ) { foreach $line(@lines) { ( $number,$sign_name,$sign_email,$sign_homepage,$sign_icon,$sign_time, +$sign_msg ) = split ( /__/, $line ) ; if ( $modnum ne $number ) { push ( @data , $line ); open(WRITE,">guestbook.dat"); print WRITE @data; close(WRITE); } } print "Loading ..."; print "<META HTTP-EQUIV=Refresh CONTENT=2;URL=viewguestbook.pl?action= +view_post&start=0&end=$show>"; }else{ print <<EOF; <center>wrong password<br> Please <a href=javascript:window.history.back()>go back</a> ! </center> EOF }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(dooberwah) Re: how can i modify the array ?
by dooberwah (Pilgrim) on Jun 05, 2002 at 13:37 UTC | |
by Anonymous Monk on Jun 05, 2002 at 20:12 UTC | |
by 12monkey (Initiate) on Jun 05, 2002 at 20:21 UTC |