Thread: use perl

    #1
  1. No Profile Picture
    12338323
    Guest
    Devshed Newbie (0 - 499 posts)
    Make a real simple perl script, and post the information to the script. Place the HTML for the second page in the script and display said information with a variable.

    Here is the code that you would need to do that. Post variable1 and variable2, then place $varable1 and $variable2 in the html for the second page:

    #!/usr/bin/perl
    print "Content-type: text/htmlnn";
    &form_parse;
    $variable1=$form('variable1');
    $variable2=$form('variable2');


    print <<endhtml

    #put html in here

    endhtml


    sub form_parse {
    read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
    @pairs = split(/&/, $buffer);
    foreach $pair (@pairs)
    {
    ($name, $value) = split(/=/, $pair);
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $FORM{$name} = $value;
    }}

  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 1999
    Posts
    2
    Rep Power
    0
    What post was this answer about? You might want to post a reply in the original thread to let people know that the answer is here.

    Pat Ricard
    The Online Advertising Space Directory - Let advertisers know that you are looking for sponsors for your site
    http://www.1001mediakits.com

Similar Threads

  1. unix perl txt read/write error on windows iis5
    By help-me-pls in forum Perl Programming
    Replies: 7
    Last Post: September 14th, 2003, 04:37 PM
  2. Perl vs PHP, I need your opinion!
    By suzanasjoqvist in forum Perl Programming
    Replies: 7
    Last Post: April 2nd, 2003, 09:48 AM
  3. Problems installing mod_perl 1.2.7 with perl 5.8.0
    By cptsanity in forum Perl Programming
    Replies: 7
    Last Post: February 20th, 2003, 07:49 AM
  4. Hello Perl Land
    By if(Kevin) in forum Perl Programming
    Replies: 4
    Last Post: July 26th, 2001, 12:28 PM
  5. Calling php script from perl cgi script
    By cschilbe in forum Perl Programming
    Replies: 1
    Last Post: May 28th, 2001, 05:52 PM

IMN logo majestic logo threadwatch logo seochat tools logo