Gossamer Forum
Home : General : Perl Programming :

Getting 'instructions' from url

Quote Reply
Getting 'instructions' from url
Hello,

I've got a question:
how do I get the 'instructions' from my url?
example: postings.cgi?action=newtopic&number=8
like this.
How can I let my script filter the action out of the url?


Thank you very much.

Niels Schenk
Quote Reply
Re: Getting 'instructions' from url In reply to
Easiest way is:

use CGI;
my $in = new CGI;

Then you can access all your variables like:

my $action = $in->param('action');

or just:

print $in->param('action');
print $in->param('number');

To print the fields action or number.

Hope this helps,

Alex