Searching with GET

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
User avatar
naim
Registered User
Posts: 50
Joined: Thu Oct 13, 2011 7:21 pm
Location: Isolation
Contact:

Searching with GET

Post by naim »

When searching something on a phpBB forum, you are currently sending a POST request.
Why not search with a GET request with the query in the url (ex. http://example.com/phpbb/search.php?q=hello%20world) - just like any search engine.
This way you will be able to make it easier for people to change their searches (sometimes i just modify the url directly instead of resubmitting...)
And people will be able to search your site directly from their browsers...

-> http://<domain>/phpbb/search.php?q={query}

User avatar
Dragosvr92
Registered User
Posts: 624
Joined: Tue May 31, 2011 12:08 pm
Location: Romania
Contact:

Re: Searching with GET

Post by Dragosvr92 »

Interesting idea, but you might want to take care of the SEO detail, as the bots will tend to cache the search page, with each get variable.
Sooo.. add a index no follow for the search page, maybe.
Previous user: TheKiller
Avatar on Memberlist 1.0.3

/a3
Registered User
Posts: 97
Joined: Mon Sep 20, 2010 6:44 am

Re: Searching with GET

Post by /a3 »

TheKiller wrote:Interesting idea, but you might want to take care of the SEO detail, as the bots will tend to cache the search page, with each get variable.
Use robots.txt.
$ git commit -m "YOLO"

User avatar
A_Jelly_Doughnut
Registered User
Posts: 1780
Joined: Wed Jun 04, 2003 4:23 pm

Re: Searching with GET

Post by A_Jelly_Doughnut »

Please be more specific. search.php processes get requests without any problems, and in fact the form at search.php already uses method=get
A_Jelly_Doughnut

User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: Searching with GET

Post by nickvergessen »

Only quick-search (Includes search on viewforum and viewtopic) use get
Member of the Development-TeamNo Support via PM

User avatar
A_Jelly_Doughnut
Registered User
Posts: 1780
Joined: Wed Jun 04, 2003 4:23 pm

Re: Searching with GET

Post by A_Jelly_Doughnut »

nickvergessen wrote:Only quick-search (Includes search on viewforum and viewtopic) use get
Not on this board... quoting from the source of search.php as generated on area51

Code: Select all

<h2 class="solo">Search</h2>

<form method="get" action="./search.php">

<div class="panel">
	<div class="inner"><span class="corners-top"><span></span></span>
	<h3>Search query</h3>
A_Jelly_Doughnut

User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: Searching with GET

Post by nickvergessen »

Well atleast the quick search is ;) sorry screwed the other one up
Member of the Development-TeamNo Support via PM

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: Searching with GET

Post by imkingdavid »

Click Advanced Search at the top (next to the Search box). Type in "test". See the URL:

Code: Select all

http://area51.phpbb.com/phpBB/search.php?keywords=test&terms=all&author=&sc=1&sf=all&sr=posts&sk=t&sd=d&st=0&ch=300&t=0&submit=Search
Really, afaik, only the search box at the top of this board does it via $_POST.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Searching with GET

Post by Oleg »

We should be using GET on search forms everywhere it makes sense. There was http://tracker.phpbb.com/browse/PHPBB3-7057 which appears to had been fixed.

User avatar
MichaelC
Development Team
Development Team
Posts: 889
Joined: Thu Jan 28, 2010 6:29 pm

Re: Searching with GET

Post by MichaelC »

Also from some quick testing 'Search these results' uses POST.
Formerly known as Unknown Bliss
psoTFX wrote: I went with Olympus because as I said to the teams ... "It's been one hell of a hill to climb"
No unsolicited PMs please except for quotes.

Post Reply