[GLLUG] CGI/Perl Script

Daniel drk@netophilia.net
Tue, 20 Aug 2002 10:16:27 -0400


Sure thing. Here:

#!/usr/bin/perl

require "./cgi-lib.pl";
print &PrintHeader;
&ReadParse(*input);

$path1=$input{'path1'};
$path2=$input{'path2'};
{do whatever you need with the input here}



Then, when you call the cgi, pass the args as:

http://blah.woof.com/foo.cgi?path1=firstpart&path2=secondpart


Is this what you need? (I suck at perl, so feel free to point out any mistakes I made here)


Adam McDougall extolled:
> Since you are so inviting... :)
> 
> Could anyone point me to or give me a crash course in passing multiple 
> variables supplied via a url to a Perl script?   Basically I want to 
> have a program pass several arguments to a CGI script that would 
> combine them to create a file path which it would deal with.  I know
> trusting user supplied paths is bad, so I figure I could give it 
> each component of the path seperately and the CGI could combine them
> using /'s to form a real path, so I can discard any /'s from user input.
> 
> _______________________________________________
> linux-user mailing list
> linux-user@egr.msu.edu
> http://www.egr.msu.edu/mailman/listinfo/linux-user

-- 
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|            Daniel           |
|      drk@netophilia.net     |
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*