I\'m trying to execute a PHP function in the same page after the user enters a text and presses a submit button.
The first I think of is using forms. When the user s
That's now how PHP works. test() will execute when the page is loaded, not when the submit button is clicked.
test()
To do this sort of thing, you have to have the onclick attribute do an AJAX call to a PHP file.
onclick