[WEB4LIB] Modified "get" action for forms?

Thomas Dowling tdowling at ohiolink.edu
Wed Nov 8 07:32:07 EST 2000


----- 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