私はちょうどemail-address-saving form on my websiteがOperaとInternet Explorer(とにかく7)、そしておそらく他のブラウザでは動作しないことを発見しました。 Firefoxでうまく動作します。残念ながら、私は開発者ではなく、フォームのコードを書いた人との接触がなくなり、修正方法はわかりません。無力非-devのために同情を感じこの電子メールアドレス提出コードがOperaとInternet Explorerで動作しないのはなぜですか?
<form action="index.php" method="post">
<input type="text" name="email" style="width: 250px;" />
<input type="image" src="img/button-submit.png" name="submit" value="Submit" style="position: relative; top: 5px; left: 10px" />
</form>
<?php echo $str ?>
誰でも、ここで働いていない何のアイデアを持っている:
<?php
$str = '';
if (isset($_POST['submit']))
{
if(!eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$", $_POST['email'])) {
$str = "<span style='color: red'>Not a valid email address</span>";
} 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');
}
}
?>
、その後、身体のビット:私はこの問題は、以下のコードとは何かを持っていると仮定します?
「動作しない」と指定してください。 –
エラーが発生しますか? IE7で失敗したらどうなるでしょうか? – You