bnanaboy has asked for the wisdom of the Perl Monks concerning the following question:

Ok, please bear with me if this is a simple question, I've only been programming in Perl for about 2 weeks now. I'm using a Perl script to query a MYSQL database and display the results in a webpage. There's too much to display every field of every row on a single page, though, so I want to show the first few fields and have the first field be a link to a page that displays the rest of the info for that item. What is the best way to pass an identifier to use in a SELECT statement on the next page?

Replies are listed 'Best First'.
Re: Passing variables to a new script
by Adam (Vicar) on Sep 29, 2000 at 22:36 UTC
    Use a cgi parameter.
    Script 1 does the massive sql query and gets all the initial data. Each record has a link to a script (could even be back to itself) with the added parameter as a get request. ( http://url/script.cgi?paramater_name=value )

    Script 2 (or 1) then receives this param ( $q->param('name') ) and does a more refined SELECT and displays the full results.

Re: Passing variables to a new script
by merlyn (Sage) on Sep 29, 2000 at 22:40 UTC
    Fire off a mini-webserver to do the query, and then redirect the browser to it. The first page can display the initial result, then include a link to get more, which reconnects to the same mini-webserver.

    That'd be a combination of column 2 and column 23 from my WebTechniques columns.

    -- Randal L. Schwartz, Perl hacker