Why is my Javascript not working from the PHP file?
<p>I have the following files. For some reason my JavaScript (inside PHP 'echo' tags) does not work:</p>

<p>HTML (index.php):</p>

<pre><code>&lt;form action="submit.php" method="post"&gt;
&lt;div id="edit-box"&gt;
&lt;INPUT type="submit" name="save-text" id="save-text" value="Save"&gt;
&lt;textarea id="editor" name="editor"&gt;
&lt;?php echo $content; ?&gt;
&lt;/textarea&gt;
&lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p>PHP (submit.php):</p>

<pre><code>&lt;?php

include('connect-db.php');

$submit_date = date("Ymd");
$content = mysql_real_escape_string(htmlspecialchars($_POST['editor']));
$ip_address = getRealIPAddress();

if ($content != '') { 
mysql_query("INSERT source SET submit_date='$submit_date', ip='$ip_address', content='$content'")
or die(mysql_error());

// The following line is not working! I need help here!
echo '&lt;script type="text/javascript"&gt; alert("Your file saved!");&lt;/script&gt;';  

mysql_close($connection);
}
?&gt;
</code></pre>

<p>The "submit.php" does not have any other PHP or HTML script/tags. I understand I am using obsolete PHP/MySQL API (instead of PDO / MySQLi), but that's beside the point.</p>
