[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Using the GET Method

Posted on 1997-08-13
2
Medium Priority
?
201 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 20 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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
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…
Suggested Courses
Course of the Month18 days, 10 hours left to enroll

834 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