Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Themes by

I need to remove this line for AMP. What will happen if I removed it ?

$q_view['main_form_tags'] = 'method="post" action="' . qa_self_html() . '"';

1 Answer

+2 votes

These are form handlers to collect data for processing to PHP which are then stored to the database.

If you remove them, you won't be able to register an action. Whether if it's posting content (asking/answering/commenting) or vote a post, depending on what this is set for.

Putting it in even simpler terms, once you click the submit button after writing a post, or clicking a vote button, nothing will happen because there's no connection to the database.

Read more about PHP forms.

Still it is safe to avoid them for unregistered users who are having read-only access right?
I think when the site is set for ready-only access these forms are not rendered, I believe.
If they do, sure, they are of no use for logged-out users, unless it's allowed to ask questions without being registered, which in that case they are still necessary.
Yes. I suppose doing amp for such non registered users makes sense as it'll be easier and most Google traffic will be them.