News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

?action=search2;search=

Started by smartdeviceresource, January 03, 2010, 11:27:00 PM

Previous topic - Next topic

Aleksi "Lex" Kilpinen

I'll move this to coding discussion, as it is probably more suited there :) Could get better responses there too.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Roph

<form action="http://www.simplemachines.org/community/index.php?action=search2" method="GET">
<input type="text" name="search">Search...</input>
</form>


The critical part is the method="GET" part. There are 2 main methods of submitting, POST and GET. POST submits "silently" (for example, you don't want to submit a post and then have the entire post text on the end of the URL), GET adds it to the URL.

This form:

<form action="http://www.simplemachines.org/community/index.php?action=search2" method="GET">
<input type="text" name="search">Search...</input>
<input type="text" name="secondvar">pizza</input>
<input type="text" name="thirdvar">pasta</input>
</form>


Would result in the end URL being http://www.simplemachines.org/community/index.php?action=search2;search=Search...&secondvar=pizza&thirdvar=pasta.

I still recommend leaving it as POST though. As was said, the breadcrumb links directly. The whole point of those breadcrumbs is a sort of "you are here" device.

Oya

the breadcrumb actually encodes the entire search string since on forums with lots of boards you can run afoul of a limitation in internet explorer

smartdeviceresource

Quote from: LexArma on November 03, 2010, 01:57:45 AM
I'll move this to coding discussion, as it is probably more suited there :) Could get better responses there too.
Awesome, Thanks.

Quote from: Roph on November 03, 2010, 05:52:55 AM
<form action="http://www.simplemachines.org/community/index.php?action=search2" method="GET">
<input type="text" name="search">Search...</input>
</form>


The critical part is the method="GET" part. There are 2 main methods of submitting, POST and GET. POST submits "silently" (for example, you don't want to submit a post and then have the entire post text on the end of the URL), GET adds it to the URL.

This form:

<form action="http://www.simplemachines.org/community/index.php?action=search2" method="GET">
<input type="text" name="search">Search...</input>
<input type="text" name="secondvar">pizza</input>
<input type="text" name="thirdvar">pasta</input>
</form>


Would result in the end URL being http://www.simplemachines.org/community/index.php?action=search2;search=Search...&secondvar=pizza&thirdvar=pasta.

I still recommend leaving it as POST though. As was said, the breadcrumb links directly. The whole point of those breadcrumbs is a sort of "you are here" device.
So assuming I did this I would just have to replace method="Post" with method="GET" in index.template.php and search.php? and nothing else
Quote from: Oya on November 03, 2010, 06:16:08 AM
the breadcrumb actually encodes the entire search string since on forums with lots of boards you can run afoul of a limitation in internet explorer
The thing is the bread crumb doesn't show in the address bar which is why it is impossible to copy/paste from the address bar to a post to tell a user
Quoteyou should search before posting. this has been answered a number of times http://yourforum//index.php?action=search2;search=question
without having to explain to every user that they must type ;search=question 
after some thought, i've learned to be humble and leave the answering to the experts, until i too am an expert.  sorry to anyone who I've confused, with my answers

Advertisement: