How to apply a php function with a button
<p>I realized that the script I wrote is attempting to use both javascript and php, and this doesn't work. Can anyone tell me how I might go about achieve what I'm looking to do? What I want to do is have a button that when clicked, it will write to file on the server. Here;s the code i wrote:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;?php
function change_html(){
     $myFile = "testFile.html";
     $fh = fopen($myFile, 'w') or die("can't open file");
     $stringData = "Hello\n";
     fwrite($fh, $stringData);
     $stringData = "World!\n";
     fwrite($fh, $stringData);
     fclose($fh);
     }
?&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;input type="button" onclick="change_html()" Value="Continue"&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Thanks in advance!!</p>
