In my js method, how can I submit to call the PHP function on this page?

in my js method request1, how can I submit to call the PHP function request? on this page

<?php

function request(){

}

?>
<html id="html">
<button id="btn_click" onclick="request1()">click</button>


</html>
<script  type="text/javascript">
    function request1(){
        document.write("<h1>been clicked</h1>");

        
    }
</script>

Dec.29,2021

you need to distinguish between the front-end and back-end concepts. php is a back-end language. The code runs on the server and the results are generated before they are displayed in the foreground.
so when your page is displayed in your eyes, the php code is not invisible, that is, js cannot directly call function of the same page php .

but it can be realized through ajax technology. The specific implementation method is not detailed. Search

on your own.
Menu