PHP button action not working
<p>The action i implemented on a submit button in PHP isn'n executed. Everything works fine, no error but when i click the button nothing happens. Notepad++ sees that the file <code>lines.php</code> has been modified.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;
        Watch your Language
    &lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;H2 align="center"&gt;
        &lt;form method="post"&gt;
            &lt;input type="submit" onclick="English()" name="introdu" value="Choose english"&gt;
        &lt;/form&gt;
        &lt;a href="index.php"&gt;Home&lt;/a&gt; | &lt;a href="bot.php"&gt;Talk to robot&lt;/a&gt;
    &lt;/h2&gt;
&lt;/body&gt;
&lt;/html&gt;

 &lt;script type="text/javascript"&gt;
function English()
{&lt;?php
         $myFile = "lines.php";
         $fh = fopen($myFile, 'w');

$eng = &lt;&lt;&lt;TEST
&lt;?php
class TextToSpeech {
    public $mp3data;
    function __construct($text="") {
        $text = trim($text);
        if(!empty($text)) {
            $text = urlencode($text);
            $lang_en="http://translate.google.com/translate_tts?tl=en&amp;q=\{$text}";
            $lang_ro="http://translate.google.com/translate_tts?tl=ro&amp;q=\{$text}";
            $lang_fr="http://translate.google.com/translate_tts?tl=fr&amp;q=\{$text}";
            $language=$lang_en;
            $this-&gt;mp3data = file_get_contents($language);
        }
    }

    function setText($text) {
        $text = trim($text);
        if(!empty($text)) {
            $text = urlencode($text);
            $en="http://translate.google.com/translate_tts?tl=en&amp;q=\{$text}";
            $ro="http://translate.google.com/translate_tts?tl=ro&amp;q=\{$text}";
            $fr="http://translate.google.com/translate_tts?tl=fr&amp;q=\{$text}";
            $lang=$en;
            $this-&gt;mp3data = file_get_contents($lang);
            return  $this-&gt;mp3data;
        } else { return false; }
    }

    function saveToFile($filename) {
        $filename = trim($filename);
        if(!empty($filename)) {
            return file_put_contents($filename,$this-&gt;mp3data);
        } else { return false; }
    }
}
?&gt;
TEST;
echo $eng;
fwrite($fh, $eng);
fclose($fh); 
?&gt;
alert("File created");
}
&lt;/script&gt;
</code></pre>
