The browser page reloads continuously infinite times when I perform the post method and for each reload, the same data is automatically added to the database continuously unlimited times. The HTML code run from VSCode. When I run the HTML file without any server(by clicking the HTML file in any browser manually) it works fine(the browser page reloads one time). Please help me to solve this issue.
This JavaScript code is to perform the POST method to post data to the database.