
TheGame+
Deleted
May 21, 2000, 10:09 PM
Post #2 of 2
(122 views)
|
|
Re: Search query values using cgi.pm
[In reply to]
|
Can't Post
|
|
In fact, the browser translates what the user types into an URL-escaped string, and the CGI.pm module will translate it back to the original value. This is usually the most handy, because you don't have to worry about how exactly these things are encoded. So you'd simply get the original query by asking for it : <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> $query = param('query'); $page = param('page');</pre><HR></BLOCKQUOTE> Unfortunately, the escape() and unescape() functions of CGI.pm are not directly available. So when you want to build your own links with the same query information, but with a different page number, it's probably easiest to change the page number like this : <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> for $nr (1 .. 10) { param('page', $nr); $myself = self_url(); print a({href=>$myself},$nr), " "; } </pre><HR></BLOCKQUOTE> You can use similar code if you're using the object-oriented syntax of CGI.pm. Maybe someone else knows a shorter way to do this ?
|