Why doesn't this email-address-submitting code work with Opera and Internet Explorer?
<p>I've just discovered the <a href="http://www.yoomoot.com" rel="nofollow">email-address-saving form on my website</a> does not work on Opera and Internet Explorer (7 at any rate), and possibly other browsers. Works fine with Firefox. Unfortunately I'm not a developer and no longer have any contact with the guy who wrote the code for the form so I've no idea how to fix it. I assume the problem has something to do with the code below:</p>

<pre><code>&lt;?php
    $str = '';

    if (isset($_POST['submit']))
    {
        if(!eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$", $_POST['email'])) {
            $str = "&lt;span style='color: red'&gt;Not a valid email address&lt;/span&gt;";
        } else {
            $file = 'emails.txt';
            $text = "$_POST[email]\n";

            if (is_writable($file)) {
                if (!$fh = fopen($file, 'a')) {
                    exit;
                }

                if (fwrite($fh, $text) === FALSE) {
                    exit;
                }

                fclose($fh);
            }
            header('Location: thankyou.html');
        }
    }
?&gt;
</code></pre>

<p>and then the body bit:</p>

<pre><code>&lt;form action="index.php" method="post"&gt;
    &lt;input type="text" name="email" style="width: 250px;" /&gt;
    &lt;input type="image" src="img/button-submit.png" name="submit" value="Submit" style="position: relative; top: 5px; left: 10px" /&gt;
&lt;/form&gt;

&lt;?php echo $str ?&gt;
</code></pre>

<p>Anybody feeling pity for a helpless non-dev and have an idea what's not working here?</p>
