Re: Allow or Disallow execution of script

by "Valerie L. Criswell" <valerie(at)suresource.net>

 Date:  Mon, 27 Aug 2001 15:47:31 -0400
 To:  <hwg-languages(at)hwg.org>
 References:  jbarchuk
  todo: View Thread, Original
Okay, I've made a little progress, thanks to some hacking from another
script, and you guys' help (thanks, btw).  I realized that the major part of
my problem was that I was not parsing the form variables sent from my CF
template.  I guess I just assumed that the script would know what they were
and how to handle them.  Boy it sure does seem to be more tedious than CF
(that's NOT a knock to Perl, just an observation).

Anyhow, I found some code that said it would process variables sent from a
form, and it appears to do just that since my "if" statement works now when
someone chooses "no".  However, when someone answers "yes", the script bombs
into never-never land and times out.  I guess it's something later on down
in the script that doesn't like my stuff (imagine that!).  The script is
over 2000 lines long *sigh*.

Does anything obvious pop out at anyone about this code that's making my
script die?

Thanks to all,

~Val

***************************************
$i=0;
  read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
  @pairs=split(/&/,$temp);
  foreach $item(@pairs)
   {
    ($key,$content)=split(/=/,$item,2);
    $content=~tr/+/ /;
    $content=~s/%(..)/pack("c",hex($1))/ge;
    $content =~ s/<!--(.|\n)*-->//g;
    $fields{$key}=$content;
    $i++;
    $item{$i}=$key;
    $response{$i}=$content;
   }

if ($fields{'iagree'} eq "no")
     {  print <<Go_to_front_door;
Content-type: text/html\n\n

<meta http-equiv="refresh"
content="0;URL=http://www.mydomain.com/thepage.cfm">
Go_to_front_door
exit;  }

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA