[WEB4LIB] Re: Modified "get" action for forms?
Chris Shaffer
shaffer at uic.edu
Wed Nov 8 17:11:10 EST 2000
Many thanks. The Location: header (described in
http://www.php.net/manual/function.header.php) does exactly what I need.
I'm still not sure the ASP solution described by another reader does what I
need. From what I can tell, it just strips the null values from the query,
not from the URL. At any rate, using the Location: header is perfect for
my needs.
Chris Shaffer
shaffer at uic.edu
At 11/8/00 12:44 PM, Thomas Dowling wrote:
>I think you'll find you're mistaken. There are Good Redirects and Evil
>Redirects, and this one--a "Location: " header in the standard CGI
>environment--is a good one. Redirects only screw up back buttons if you
>use the '<meta http-equiv="refresh" content="0;...' hack.
>
>Thomas Dowling
>OhioLINK - Ohio Library and Information Network
>tdowling at ohiolink.edu
>
>
>----- Original Message -----
>From: "Chris Shaffer" <shaffer at uic.edu>
>To: "Multiple recipients of list" <web4lib at webjunction.org>
>Sent: Wednesday, November 08, 2000 1:37 PM
>Subject: [WEB4LIB] Re: Modified "get" action for forms?
>
>
> > Unfortunately, this solution uses a redirect, which disables the user's
> > back button, which is something I need to avoid.
> >
> > Chris Shaffer
> > shaffer at uic.edu
> >
> > At 11/8/00 06:32 AM, you wrote:
> > >----- Original Message -----
> > >From: "Chris Shaffer" <shaffer at uic.edu>
> > >To: "Multiple recipients of list" <web4lib at webjunction.org>
> > >Sent: Tuesday, November 07, 2000 5:22 PM
> > >Subject: [WEB4LIB] Modified "get" action for forms?
> > >
> > >
> > > > I have a database search form with many input fields, only a few of
>which
> > > > are used in the average search. I'd like the search logic to be
>embedded
> > > > in the URL so that search results pages can be bookmarks or
> > > > favorites. However, action="get" puts all the fields in the URL,
>which
> > > > results in a very long URL. I'd like to generate a URL that only
>includes
> > > > non-null input fields. Is there any way to do this that 1) does not
>use
> > > > javascript and 2) does not disable the browser back button via
>redirect?
> > > >
> > > > FYI, our web server is Unix, Apache, PHP, MySQL.
> > > > -----
> > >
> > >I dunno from PHP, but your script should be able to:
> > >
> > > Examine the QUERY_STRING environment variable to
> > > see if there are null values
> > >
> > > If there are null values,
> > > strip them out of the
> > > QUERY_STRING and
> > >
> > > send a redirect to itself
> > >
> > > If there are no null values, execute the search
> > >
> > >The user will end up seeing only non-null values in the URL.
> > >
> > >Thomas Dowling
> > >Ohio Library and Information Network
> > >tdowling at ohiolink.edu
> >
> >
More information about the Web4lib
mailing list