CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
param() vs url_param()

 



xinul22
Deleted

Sep 10, 2000, 11:53 AM

Post #1 of 2 (417 views)
param() vs url_param() Can't Post

I have a problem figuring out the difference between param() and url_param() and also, I guess, between GET and POST methods for <form> submissions.

I want to pass name=value pairs to my script from my Web page both from a <form> submission (eg- <form method=post action=/.../cgi-bin/script.pl> ) and from a <a> tag with name=value pairs encoded on the URL (eg- <a href=http://.../cgi-bin/script.pl?firstName=James&lastName=Bond> ).

I have 2 questions. First, does the GET method pass name=value pairs on the URL as I written above? What is the difference between POST and GET methods when passing name=value pairs?

Second, do I use url_param() to get the values when it is passed as encoded on the URL, as I written above? Or do I use param() instead?

Thanks in advance.


japhy
Enthusiast

Sep 10, 2000, 2:46 PM

Post #2 of 2 (417 views)
Re: param() vs url_param() [In reply to] Can't Post

GET queries send the data in the URL (via the QUERY_STRING environment variable). POST sends it via standard input.

You only need to use the url_param() method when you make a form that sends information BOTH via POST and GET:

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


<form method="POST" action="/cgi-bin/foo.cgi?a=b&c=d">
</pre><HR></BLOCKQUOTE>

------------------
Jeff "japhy" Pinyan -- accomplished author, consultant, hacker, and teacher


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives