Solved: 11 Months, 1 Week, 1 Day ago ACP > Legalize POST button
#1
Solved: 11 Months, 1 Week, 1 Day ago
I'm a beginner and need some help for a problem which seems to be a small one for you and which seems to be an unsolvable task for me.

I have defined a button in a PlugIn with which I delete a file. The button is displayed correctly.

This is how the code in the PlugIn looks like:

$form_container = new FormContainer();
 $form_container->output_row("<form action=\"\" method=\"post\">
<input type=\"submit\" name=\"delete_file\" value=\"$lang->_delete_1\"/> $lang->delete_2
</form>", "", "");
$form_container->end();
if(isset($_POST["delete_file"])) {
unlink(MYBB_ROOT . "/"filename);
} 
If I click on the button, the desired function is executed correctly!

However, the message appears:
Quote:The authorization code could not be confirmed. Please confirm that you want to perform this action.
Currently I hide the error message after the "unlink" with a META Refresh, but this should certainly not be the wisdom last resort.

How to legalize the operation ($_POST) in the PlugIn so that the error message does not appear?

Thank you for any help in advance.
Reply


Messages In This Thread
ACP > Legalize POST button - by Fontane - 2020-11-08, 12:05 PM
RE: ACP > Legalize POST button - by Crazycat - 2020-11-08, 04:13 PM
RE: ACP > Legalize POST button - by Fontane - 2020-11-08, 05:21 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)