404 Error Route 'index.php' not found

I am using the following script in Custom File:

if(isset($_POST['submit']))
{
echo $vbranch = $_POST['branchid'];
}
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<input type='text' id = 'branchid' name='branchid'>
<input type='submit' name='submit' value='View Report'>
</form>

but after input, following error is occurring:
404
Error
Route ‘index.php’ not found.this script was working fine in version 2020.any advise ?

Simply change your code to:

<?php
if(isset($_GET['submit']))
{
echo $vbranch = $_GET['branchid'];
}
?>
<form method="get" action="">
<input type='text' id = 'branchid' name='branchid'>
<input type='submit' name='submit' value='View Report'>
</form>

Now there is no 404 error, but showing nothing.

It should work as I’ve tried it and it works properly.

https://discourse.hkvstore.com/t/error-when-browsing-newly-generated-site/3611/1