Getting back to 'Ask a Question' suggestion screen

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
juser
Posts: 13
Joined: Mon Feb 08, 2010 3:27 pm

Getting back to 'Ask a Question' suggestion screen

Post by juser »

Hi,

A user asks a question and is presented with similar FAQs, then they click on one of them. If that FAQ does not satisfy them, how do they go back to try the other suggestions? If they use the back button, the browser complains because it's re-submitting the 'Ask Question' form. The user must refresh the page. Also, if the captcha is enabled, the refresh does not work. You can test this problem at http://faq.phpmyfaq.de/ . You can't go back to the suggestions.

I'm trying to get the 'Ask Question' form to submit as a get instead of a post, but the better solution may be a button they can select to re-submit and view the suggestions again.

Any help is appreciated.

Thanks,
Joe
juser
Posts: 13
Joined: Mon Feb 08, 2010 3:27 pm

Re: Getting back to 'Ask a Question' suggestion screen

Post by juser »

Here's the temporary "adjustment" I made to allow users to go back to the list of suggestions when using "Ask Question".

In template\ask.tpl I changed the form's method attribute from post to get. Then I added a hidden field <input name="action" type="hidden" value="savequestion" /> because it was submitting without it.

Next, I changed savequestion.php in the root directory and made all these INPUT_GET vs. INPUT_POST. Note: we have captcha disabled, but I changed that anyway.

$username = PMF_Filter::filterInput(INPUT_GET, 'username', FILTER_SANITIZE_STRING);
$usermail = PMF_Filter::filterInput(INPUT_GET, 'usermail', FILTER_VALIDATE_EMAIL);
$usercat = PMF_Filter::filterInput(INPUT_GET, 'rubrik', FILTER_VALIDATE_INT);
$content = PMF_Filter::filterInput(INPUT_GET, 'content', FILTER_SANITIZE_STRIPPED);
$code = PMF_Filter::filterInput(INPUT_GET, 'captcha', FILTER_SANITIZE_STRING);

Everything seems to work, but I do realize this is probably NOT the best way to handle it.

Thanks,
Joe
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Getting back to 'Ask a Question' suggestion screen

Post by Thorsten »

Hi,

our plan is to change the whole form behaviour of phpMyFAQ in the next big release.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply