Solved

Using the GET Method

Posted on 1997-08-13
2
180 Views
Last Modified: 2013-12-25
How do I parse the input from an HTML when using the GET method (using perl)?
0
Comment
Question by:ron_sh
2 Comments
 
LVL 1

Accepted Solution

by:
gabsi earned 10 total points
ID: 1829658
When you use the get method, data is palced in argv, exactly like if you make
pgm.pl arg1 arg2 arg3....
If you use FORMs, it becomes like:
pgm.pl fied1=value1 field2=value2...
0
 
LVL 2

Expert Comment

by:aleshka
ID: 1829659
There is two variants:

1. When you receive GET requests, you have two environment  variables setted:

 REQUEST_METHOD=GET - to be shure that method is GET.
 QUERY_STRING=field1=val1&field2=val2 etc.. - it you must parse.

2. Use CGI perl module which will do all needed work and will give you all parameters in very nice form, you just call some function from it "param" with field name and receives its value.

PS: if you are using CGI module, you even don't need to know, which method is used now, You'll receive all parameters in same manner for GET, POST and even CGI Upload (mulltipart) methods.

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now