Im Firefox funktioniert das Captcha einwandfrei, aber im Internet Explorer wird immer ausgegeben, dass der Code falsch sei. Dabei habe ich die Sicherheitsstufe ganz runtergesetzt.
Formular:
Code:
<?php
// ...
$inhalt .= "<form action=\"index.php?section=gb_insert\" method=\"post\" name=\"gbeintrag\" class=\"formular\">\n";
$inhalt .= " <p class=\"inhalt\"><label for=\"name\">Name</label><br />\n";
$inhalt .= " <input type=\"text\" name=\"Name\" id=\"name\" class=\"input\" /></p>\n";
$inhalt .= " <p class=\"inhalt\"><label for=\"email\">Email</label><br />\n";
$inhalt .= " <input type=\"text\" name=\"Email\" id=\"email\" class=\"input\" /></p>\n";
$inhalt .= " <p class=\"inhalt\"><label for=\"homepage\">Homepage</label><br />\n";
$inhalt .= " <input type=\"text\" name=\"Homepage\" id=\"homepage\" class=\"input\" /></p>\n";
$inhalt .= " <p class=\"inhalt\"><label for=\"beitrag\">Beitrag</label><br />\n";
$inhalt .= " <textarea name=\"Text\" id=\"beitrag\" cols=\"50\" rows=\"10\" class=\"textarea\"></textarea></p>\n";
// Sicherheitsabfrage
$inhalt .= " <p class=\"inhalt\">\n";
$inhalt .= " <img src=\"captcha/captcha.php\" border=\"0\" title=\"Sicherheitscode\"></p>\n";
$inhalt .= " <p class=\"inhalt\"><label for=\"sicherheitscode\">Sicherheitscode</label><br>\n";
$inhalt .= " <input type=\"text\" name=\"sicherheitscode\" size=\"5\" class=\"input\">\n";
$inhalt .= " </p>\n";
// -----
$inhalt .= " <p class=\"inhalt\"><input type=\"submit\" name=\"submit\" value=\"Speichern\" class=\"button\" />\n";
$inhalt .= " <input type=\"reset\" name=\"reset\" value=\"Zurücksetzen\" class=\"button\" /></p>\n";
$inhalt .= "</form>\n";
// ...
?>
Einbau ins Script:
Code:
<?php
$subnavi .= "<a href=\"?section=guestbook\"><img src=\"images/button_uebersicht.gif\" border=\"0\" alt=\"Übersicht\" onMouseOver=\"this.src='images/hover_uebersicht.gif'\" onMouseOut=\"this.src='images/button_uebersicht.gif'\" style=\"margin:2px 0 0 20px;\"></a>\n";
$subnavi .= "<a href=\"?section=gb_add\"><img src=\"images/button_eintragen.gif\" border=\"0\" alt=\"Eintragen\" onMouseOver=\"this.src='images/hover_eintragen.gif'\" onMouseOut=\"this.src='images/button_eintragen.gif'\" style=\"margin:2px 0 0 20px;\"></a>\n";
$sql = "DELETE FROM
fch_gaestebuch_ip
WHERE
DATE_SUB(NOW(), INTERVAL 1 MINUTE) > Datum";
mysql_query($sql) OR die(mysql_error());
$check = true;
session_start();
if($_SERVER['HTTP_USER_AGENT'] == "Bot") {
die("Nix da");
}
if(isset($_SESSION['captcha_spam']) AND $_POST["sicherheitscode"] == $_SESSION['captcha_spam']){
unset($_SESSION['captcha_spam']);
// ....
} else {
$inhalt .= "<b>Der Sicherheitscode ist falsch!</b>\n";
?>
An der captcha.php hab ich nichts geändert!