Umgekehrte Funktion

Hier werden Probleme rund um das Zahlen Captcha behandelt

Moderator: frameguard

Umgekehrte Funktion

Beitragvon bartaman » 02.03.2007, 16:52

Hallo Leute,
bin beinahe am Verzweifeln!!!!!

Wenn ich den Captcha CODE nicht oder falsch eingebe wird ins Gästebuch geschrieben und wenn der CODE richtig eingegeben wird kommte die Fehlermeldung!!!! ??????????????

hier der CODE:

<?php require_once('../Connections/lfwf.php'); ?>
<?php

session_start();


function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}


function encrypt($string, $key) {
$result = '';
for($i=0; $i<strlen($string); $i++) {
$char = substr($string, $i, 1);
$keychar = substr($key, ($i % strlen($key))-1, 1);
$char = chr(ord($char)+ord($keychar));
$result.=$char;
}
return base64_encode($result);
}
$sicherheits_eingabe = encrypt($_POST["sicherheitscode"], "29jfkd921");
$sicherheits_eingabe = str_replace("=", "", $sicherheits_eingabe);
if($sicherheits_eingabe == $_SESSION['rechen_captcha_spam']){
unset($_SESSION['rechen_captcha_spam']);


if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO landesfwfgb (Id, datum, name, email, www, ort, ip, nachricht) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['Id'], "int"),
GetSQLValueString($_POST['datum'], "text"),
GetSQLValueString($_POST['name'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['www'], "text"),
GetSQLValueString($_POST['ort'], "text"),
GetSQLValueString($_POST['ip'], "text"),
GetSQLValueString($_POST['nachricht'], "text"));

mysql_select_db($database_lfwf, $lfwf);
$Result1 = mysql_query($insertSQL, $lfwf) or die(mysql_error());


$insertGoTo = "../gbuch/index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}}
else
{
echo "falscher code";
}

?>
bartaman
 
Beiträge: 1
Registriert: 02.03.2007, 16:49

Zurück zu Zahlen Captcha

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste

cron