Home: Perl Programming Help: Beginner:
Reading HTML parameters



RayStreet
Deleted

Jan 1, 2000, 5:57 PM


Views: 5565
Reading HTML parameters

I have an HTML page which is dynamically built from a search using cgi/perl. There are several products on the page and each product has a reference. There is an HREF link from each product which passes the product code preceded by a "?" (for example, the href link is /cgi-bin/proddets.cgi?ABCDE"). How do I pick up the code in the cgi/perl program? It's not in any of the $ENV areas that I can find.


Borderline
Deleted

Jan 2, 2000, 10:24 AM


Views: 5565
Re: Reading HTML parameters

It should be in $ENV{QUERY_STRING}. Here are some of the ENV variables along with a query string.

If you are going to write CGI's with Perl I would highly recommend you use the standard library for CGI's,CGI.pm. It provides methods for retrieving the query string along with a lot more helpful things.

Scott


RayStreet
Deleted

Jan 2, 2000, 1:54 PM


Views: 5565
Re: Reading HTML parameters

Thanks for the reply Borderline. I was using the QUERY_STRING variable but it was always empty. After a lot of debugging and messing about I discovered my problem was caused by the product codes beginning with the hash (#) symbol - once I removed the # then everything worked just fine.

Ray