I have a form which is being echoed by php:
echo '<form action="stsupport.php" method="POST">
<p>
Priority Name: <input type="text" size="50" name="ticketpriority" placeholder="Input a name for your priority..."></textarea>
</p>
<input type="submit" name="submitpriority" value="submit">
</form>';
I want the stsupport php file to run when the form is submitted but I am getting 404 error when the form is submitted.
The stsupport.php file is in the same folder as the file with the form.
Any ideas?
Edit:
This is in the support.php file where i call the function to create priority. The create priority function just displays the form above.
require_once(ABSPATH . 'wp-content\plugins\stsupport\adminmenu.php');
create_priority();
When the form is submitted i want to run:
function st_support(){
require_once(ABSPATH . 'wp-content\plugins\stsupport\adminmenu.php');
create_priority();
if (isset($data['submitpriority'])) {
insert_priority();
}
}
The insert_priority function is inside the adminmenu.php file
Try open stsupport.php via browser
Check your htaccess rule, if exist
Check file permission
Or
if(file_exists('stsupport.php')){
$action = 'stsupport.php';
}else{
$action = '';
}
echo '<form action="'. $action .'" method="POST">
<p>
Priority Name: <input type="text" size="50" name="ticketpriority" placeholder="Input a name for your priority..."></textarea>
</p>
<input type="submit" name="submitpriority" value="submit">
</form>';
Try to type the the full directory of the root folder in the form. also set the name of the form as the name attribute in the input tag.'<form name='submitpriority' action="../DIRECTORY/stsupport.php" method="POST">