workman_m has asked for the wisdom of the Perl Monks concerning the following question:
Here is the perl<?php //upload and unzip a package //this file needs to be in adminstrator folder //and the unzip.cgi needs to be in the cgi-bin folder if(!isset($_POST['upload'])) { echo " This program uploads a zip file via ftp to a server <br>"; echo " In a particular directory and then unzips it there <br>"; echo " Usage: dir = directory you want it in <br>"; echo " Example: /frog/dog/cat <br>"; echo " Usage: zip = the zip file you want uploaded and unzips <br +>"; echo " Example: phpwcms_1.3.3.zip <br>"; echo ' <form name="upload" method="POST" action="http://mydomain.com/cg +i-bin/undone.cgi"> dirname<input name=dir size=55> <br /> zipname<input name=zip size=55> <br /> <input type="submit" name="upload" value="Upload"> </form> '; } else { } ?>
If i hardcode the values of dir and zip like this cd /dog/cat and unzip rat.zip they work just fine...#!/usr/bin/perl -w print "Content-type: text/plain\n\n"; use CGI; my $query = new CGI; my $dir = $query->param('dir'); my $zip = $query->param('zip'); ## Here is the commands that wont work cd $dir unzip $zip ## Here i can print them...just fine print $dir; print $zip;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML Form and Perl
by pc88mxer (Vicar) on May 07, 2008 at 17:29 UTC | |
by workman_m (Initiate) on May 07, 2008 at 19:16 UTC | |
by workman_m (Initiate) on May 07, 2008 at 19:32 UTC | |
|
Re: HTML Form and Perl
by kyle (Abbot) on May 07, 2008 at 16:45 UTC | |
|
Re: HTML Form and Perl
by hesco (Deacon) on May 08, 2008 at 02:43 UTC | |
|
Re: HTML Form and Perl
by almut (Canon) on May 08, 2008 at 04:44 UTC | |
by Anonymous Monk on May 08, 2008 at 22:42 UTC | |
by almut (Canon) on May 09, 2008 at 00:34 UTC |