By colm_iqc on
I'm creating a 'search' module that plugs into an external system and displaying the results in the standard drupal framework, which is all working when I use a static test query.
However I want to pass a query into it from a form, and I'm having trouble passing that in.
I can pass in:
http://www.mysite.com/dbsearch/queryterm
but I want to pass in:
http://www.mysite.com/dbsearch?query=queryterm
Because it's a form submission and that's the way a GET form will create the search URL, and I don't want to have to use javascript to do this as no javascript means no search.
Comments
Small change needed
Even with clean URLs on Drupal is using a path like http://www.mysite.com?q=dbsearch, the query=queryterm looks like a second query parameter. If you change
by replacng the ? with a & like this
it should work
That won't work, there's
That won't work, there's parsing and string checking in drupal core, it will accept the ? character and assume it's a new parameter, but in my module how to I give a wildcard/parameter as a path. when I ammend the ? or even the & I get a 404.
How are you building the string
If you use either the url() or l() function they both support building a url with a query. The other half of the question is how are you defining the callback path in the menu hook?