Creating a page with a fillable sheet [SOLVED]
#8
I suppose the form action will redirect to the same page to execute its inputs, right? Then inside your character_sheet_form() function you should include a check for HTML method, and run your code inside such check if it is a post method (which it is as per your above code). In the following plugin I add a new page inside the moderator panel, and imply check if the HTML method is by post, then run my verification and insert code.
https://github.com/Sama34/OUGC-Avatar-Ap...l.php#L751 (new page generation)
https://github.com/Sama34/OUGC-Avatar-Ap...l.php#L779 (HTML post method check and code inside it)

I have a preference for using the same action url for both, displaying the page (not post method) and running the form post data. If you want to do it separately you can check how mybb does it itself in pretty much any page.
https://github.com/mybb/mybb/blob/featur....php#L1655 (page generation)
https://github.com/mybb/mybb/blob/featur....php#L1488 (HTML post form method code)

It seems easier to me to display in-line errors and save code the way I do it, but there is not really much difference.
Reply


Messages In This Thread
RE: Creating a page with a fillable sheet - by Omar G. - 2019-01-03, 08:42 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)