Using form method=_POST in custom PHP files

PdePutter

New member
Hi ,

Recently I decided to strengthen security of my solution, by changing the “GET” method to “POST”.
However I cannot get this working.
In my main_menu.php I added a form with method = “POST”, but the value of the buttons is never submitted to the main_menu.php file.

Could you help me out here?

Thanks,
Peter

Your current DaDaBIK version
You are using DaDaBIK version 11.8-Elba enterprise, installed on 12-30-2022 (installation code: 1768361e89a9bede71), the latest version of DaDaBIK is 11.8-Elba released on 12-05-2022
You are running the latest release of DaDaBIK

System info
PHP Version: 7.4.32
mysql version: 5.5.5-10.4.26-MariaDB
Web server: Apache/2
Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Config/91.2.9001.2
 

deep64blue

DaDaBIK Guru
Can you post the contents of main_menu.php here please?

By the way in case you didn't know you can check what is being passed to your form via:-

PHP:
<?php print_r($_POST); ?>
 

PdePutter

New member
Thanks for your reply.
I am familiar with the print_r ($_POST); This statement does not return any values. However, print_r($_GET) does return the values that are sent to the php file.

My main_menu.php is rather long. I am building a simulator (inserting simulated data into the tables) around dadabik.
Basically I am building:
<a href='index.php?function=show_static_page&id_static_page=1&title=StartMenu&spname=spCreateDagomzet'>Somestring</a>
where spname=spCreateDagomzet is a Stored Procedure in MySQL. that has to be called on the server.
This is processed in main_menu.php.. However, the URL including the querystring for "spname" remains in the history of the browser. This is not what I want...

Not sure if this all makes sense.. Please ask clarification if needed...
 

PdePutter

New member
In the meantime this problem has been solved. However, not by using "POST" method for a form.
This has been solved by "document.location.replace" after running the PHP function (which calls the Stored Procedure in MySQL). The current URL is than deleted from the history of the browser. This works perfectly.
Thanks for your help.
 
Top