For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > December 2005 > Storing a search string









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Storing a search string
Thom Hehl

2005-12-15, 6:55 pm

I have a screen that is gotten to by a rather elaborate search string. I
want to put a button on that page that calls a CGI and passes it
location.href, which has all of the parameters I need to get back to
that page. The problem is, how do I do that without it mucking up the
search string with all of the ? and &s?

Anyone?

Thanks.

Thom Hehl
Heavyweight Software for Heavyweight Needs
www.heavyweightsoftware.com
--
"In every revolution, there is one man with a vision."--Jerome Bixby


Sean Davis

2005-12-15, 6:55 pm




On 12/15/05 3:26 PM, "Thom Hehl" <thom@nowhereatall.com> wrote:

> I have a screen that is gotten to by a rather elaborate search string. I
> want to put a button on that page that calls a CGI and passes it
> location.href, which has all of the parameters I need to get back to
> that page. The problem is, how do I do that without it mucking up the
> search string with all of the ? and &s?


Make the button a form submit button and put all of your CGI parameters into
the form as hidden fields.

Sean


Owen Cook

2005-12-15, 6:55 pm


On Thu, 15 Dec 2005, Thom Hehl wrote:

> I have a screen that is gotten to by a rather elaborate search string. I
> want to put a button on that page that calls a CGI and passes it
> location.href, which has all of the parameters I need to get back to
> that page. The problem is, how do I do that without it mucking up the
> search string with all of the ? and &s?
>
> Anyone?



Well perhaps I misunderstand the question, but all those ? and &s are
the way cgi works. If you do not send them the cgi script will have
nothing to parse (or collect) and nothing will be done.

If you are worried about line wrap, then as long as there is no new line
character in the string, it should be ok

Also if you are worried about constructing the string, it may be best to
build it up, like

my $search_string = '?query=';
my $first_query ='car';
my $search_string = "my $search_string$first_query";

and so on


Owen

Wiggins d'Anconia

2005-12-15, 6:55 pm

Thom Hehl wrote:
> I have a screen that is gotten to by a rather elaborate search string. I
> want to put a button on that page that calls a CGI and passes it
> location.href, which has all of the parameters I need to get back to
> that page. The problem is, how do I do that without it mucking up the
> search string with all of the ? and &s?
>
> Anyone?
>
> Thanks.
>
> Thom Hehl
> Heavyweight Software for Heavyweight Needs
> www.heavyweightsoftware.com


If I understand you correctly, you should have a look at HTML::Entities.

http://danconia.org
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com