Welcome! Log In Create A New Profile


Omit the ?search=1 parameter?

Posted by Josh 
Omit the ?search=1 parameter?
April 04, 2007 01:29PM
Hey dear developer

Is there a way to omit the search=1 parameter when doing a search? I can't really imagine that this is needed, I guess it would be a better way to just check whether $_GET['query'] is set or not:

if(isset($_GET['query'])) {
// same as $_GET['search'] == 1
... do some cool stuff...

My problem is that I want to call Sphider from my MediaWiki, and MediaWiki uses an input field with the name 'search' for the search term... So I have to do some magic using javascript when someone presses the "Search using Sphider" button:

- Change the action attribute of the form to "my/dir/to/sphider/search.php", that's ok!
- Copy the value of the input field "search" to a hidden field "query", that's OK too!
- Set the value of "search" to 1, which is not OK!

You understand my problem? :-) Would be great if you could change this or at least if you could make the "search=1" variable specifyable, so I could use another var name, something like:

$config[search_var] = 'search' // Change this to whatever you like!

Thanks a lot,
Re: Omit the ?search=1 parameter?
April 04, 2007 10:56PM
I understand your problem, but it seems it's probably quite easy for you with your background knowledge to modify it.
Re: Omit the ?search=1 parameter?
April 06, 2007 10:55AM
Yes I guess so, I just wanted to suggest that you would take it in your project source code. If it really is so un-needed as I guessed in my first post, then probably your project should be optimized for all users.
Sorry, only registered users may post in this forum.

Click here to login