• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Captcha Funktioniert nicht

Hmmm .... sicher, dass es keine gibt? Oder nur ausgeblendet?
PHP:
<?php
error_reporting( E_ALL);
?>
bei den Script-Starts sollte hier helfen.

Der 2. Schritt ist die Analyse an den entsprechenden Stellen (Übergabe der Werte per POST, Initialwerte des Captcha, vergleich, ...)

Wir können nichts tun, weil wir den Code - sprich die Dateien auf Deinen Server - nicht kennen ....

Gruß,
JumperII
 
Werbung:
Habe hier mein Codes zu Verfügung gestellt

Captcha.php Code:
PHP:
<?php
/**
*
* @package Itschi
* @since 2007/05/25
*
*/

session_start();
srand ((double)microtime() * 1000000);

$Z = 'abcdefghijklmnopqrstuvwxyz0123456789';
$path = '../images/captcha/';
$Y = strlen($Z) - 1;
$B = array($Z{rand(0,$Y)}, $Z{rand(0,$Y)}, $Z{rand(0,$Y)}, $Z{rand(0,$Y)});

$_SESSION['sicherheitscode'] = md5($B[0].$B[1].$B[2].$B[3]);

$I = imagecreatefromgif($path . 'captcha.gif');
$X = array(
    ImageColorAllocate($I,96,135,91),
    ImageColorAllocate($I,84,111,124),
    ImageColorAllocate($I,137,88,85),
    ImageColorAllocate($I,107,100,117),
    ImageColorAllocate($I,165,148,132),
    ImageColorAllocate($I,127,97,80),
    ImageColorAllocate($I,134,157,168),
    ImageColorAllocate($I,232,218,211)
);

ImageTTFText($I, rand(40,48), rand(-20,20), rand(7,11), rand(30,60), $X[7], $path . 'font' . rand(1,3) . '.ttf', $Z{rand(0,$Y)});
ImageTTFText($I, rand(33,38), rand(-20,20), rand(48,56), rand(30,60), $X[7], $path . 'font' . rand(1,3) . '.ttf', $Z{rand(0,$Y)});
ImageTTFText($I, rand(53,58), rand(-20,20), rand(94,99), rand(30,60), $X[7], $path . 'font' . rand(1,3) . '.ttf', $Z{rand(0,$Y)});
ImageTTFText($I, rand(23,28), rand(-20,20), rand(133,140), rand(30,60), $X[7], $path . 'font' . rand(1,3) . '.ttf', $Z{rand(0,$Y)});
ImageTTFText($I, rand(23,28), rand(-20,20), rand(7,11), rand(30,60), $X[rand(0,6)], $path . 'font' . rand(1,3) . '.ttf', $B[0]);
ImageTTFText($I, rand(23,28), rand(-20,20), rand(48,56), rand(30,60), $X[rand(0,6)], $path . 'font' . rand(1,3) . '.ttf', $B[1]);
ImageTTFText($I, rand(23,28), rand(-20,20), rand(94,99), rand(30,60), $X[rand(0,6)], $path . 'font' . rand(1,3) . '.ttf', $B[2]);
ImageTTFText($I, rand(23,28), rand(-20,20), rand(133,140), rand(30,60), $X[rand(0,6)], $path . 'font' . rand(1,3) . '.ttf', $B[3]);

imageline($I, 0, 0, 210, 0, $X[7]);
imageline($I, 0, 69, 210,69, $X[7]);
imageline($I, 0, 0, 0, 69, $X[7]);
imageline($I, 209, 0, 209, 69, $X[7]);
imageline($I, rand(10,30), rand(10,30), rand(150,170), rand(50,65), $X[7]);
imageline($I, rand(10,30), rand(50,65), rand(150,170), rand(10,30), $X[7]);

header('Content-type: image/gif');
ImageDestroy(ImageGIF($I));

?>

Register.php Code:
PHP:
<?php
/**
*
* @package Itschi
* @since 2007/05/25
*
*/

require 'base.php';

$error = '';
$deny =    array();
$username =    (isset($_POST['username'])) ? $_POST['username'] : '';
$email =    (isset($_POST['email'])) ? $_POST['email'] : '';
$password =    (isset($_POST['password'])) ? $_POST['password'] : '';
$password2 =    (isset($_POST['password2'])) ? $_POST['password2'] : '';

if (isset($_POST['submit']))
{
    include 'includes/functions_user.php';

    if (!$username)
    {
        $error = 1;
    }
    else if (!valid_username($username))
    {
        $error = 2;
    }
    else if (strlen($username) < 3 || strlen($username) > 15)
    {
        $error = 3;
    }
    else if (in_array(strtolower($username), $deny))
    {
        $error = 4;
    }
    else if (username_exists($username))
    {
        $error = 5;
    }
    else if (!valid_email($email))
    {
        $error = 6;
    }
    else if (email_exists($email))
    {
        $error = 7;
    }
    else if (strlen($password) < 6)
    {
        $error = 8;
    }
    else if ($password != $password2)
    {
        $error = 9;
    }
    else if ($config['enable_captcha'] && md5(strtolower($_POST['captcha'])) != $_SESSION['sicherheitscode'])
    {
        $error = 10;
    }
    else
    {
        if ($config['unlock_delete'] != 0)
        {
            $db->query('

                DELETE FROM ' . USERS_TABLE . '
                WHERE user_register < ' . (time() - $config['unlock_delete']*24*3600) . "
                AND user_unlock <> ''
            ");
        }

        $unlock_id = unlock_id();

        $db->query('

            INSERT INTO ' . USERS_TABLE . "
            (user_unlock, username, user_password, user_email, user_register, user_ip) VALUES
            ('" . $unlock_id . "', '" . $db->chars($username) . "', '" . md5($password) . "', '" . $db->chars($email) . "', " . time() . ", '" . $_SERVER['REMOTE_ADDR'] . "')
        ");

        $user_id = $db->insert_id();

        if ($config['enable_unlock'])
        {
            @mail($email, 'Bestätige Deine E-Mail', "Hallo " . $username . ", \n \n Du musst Deine E-Mail bestätigen, um die Registrierung abzuschließen. \n \n Klicke dazu auf folgenden Link: \n \n http://" . $_SERVER['HTTP_HOST'] . (dirname($_SERVER['PHP_SELF']) == '/' ? '' : dirname($_SERVER['PHP_SELF'])) . "/register.php?u=" . $user_id . "&token=" . $unlock_id . " \n \n \n Viel Spaß weiterhin! \n \n ", 'from:' . $config['email']);
        }
        else
        {
            $_REQUEST['token'] = $unlock_id;
        }

        $_GET['u'] = $user_id;
    }
}

if (empty($_GET['u']))
{
    $username = htmlspecialchars($username);
    $email = htmlspecialchars($email);
    $password = htmlspecialchars($password);

    $tpl->assign(array(
        'TITLE_TAG'        =>    'Registrieren | ',
        'ERROR'            =>    $error,
        'USER_USERNAME'        =>    $username,
        'EMAIL'            =>    $email,
        'PASSWORD'        =>    $password,
        'PASSWORD2'        =>    $password2,
        'ENABLE_CAPTCHA'    =>    $config['enable_captcha'],
        'ENABLE_UNLOCK'        =>    $config['enable_unlock']
    ));

    $tpl->display('register.tpl');
}
else
{
    $error = '';
    $token = (isset($_REQUEST['token'])) ? $_REQUEST['token'] : '';

    $res = $db->query('

        SELECT user_id, username, user_unlock, user_email, user_password
        FROM ' . USERS_TABLE . '
        WHERE user_id = ' . (int)$_GET['u']
    );

    $row = $db->fetch_array($res);
    $db->free_result($res);

    if (!$row['user_id'])
    {
        message_box('Das Mitglied wurde nicht gefunden', 'forum.php', 'zur&uuml;ck zum Forum');
    }

    if (!$row['user_unlock'])
    {
        message_box('Du kannst dich jetzt einloggen', 'login.php', 'weiter zum Login');
    }

    if ($token)
    {
        if ($token == $row['user_unlock'])
        {
            $db->query('

                UPDATE ' . USERS_TABLE . "
                SET user_unlock = ''
                WHERE user_id = " . $row['user_id']
            );

            config_set('newest_user_id', $row['user_id']);
            config_set('newest_username', $row['username']);
            config_set('newest_user_level', 0);
            config_set_count('users_num', +1);

            @mail($row['user_email'], $row['username'] . ' -  Du bist jetzt ein Mitglied!', "Hallo " . $row['username'] . "! \n \n Du bist jetzt ein Mitglied der Community. \n \n \n \n Viel Spaß weiterhin! \n \n ", 'from:' . $config['email']);

            message_box('Du hast dich erfolgreich registriert', 'login.php', 'weiter zum Login');
        }
        else
        {
            $error = 1;
        }
    }

    $tpl->assign(array(
        'TITLE_TAG'    =>    'Registrieren | ',
        'TOKEN'        =>    htmlspecialchars($token),
        'ERROR'        =>    $error,
        'USER_ID'    =>    $row['user_id'],
        'USERNAME'    =>    $row['username']
    ));

    $tpl->display('register_unlock.tpl');
}

?>
 
ich vermute mal,dass irgendein Pfad nicht mehr korrekt ist
Wenn du umgezogen bist und vorher alles funktioniert hat,dann kann es nur daran liegen.....

ich würde mal die Pfadangaben überprüfen und die vollständigen Pfade angeben
 
Werbung:
Hmmm, da fehlen noch immer ein paar Dateien, um zu testen ...

Oder Du fängst an, selber zu debuggen .... einfach zur kontrolle an den entsprechenden Stellen die Werte zusätzlich ausgeben lassen ...

Gruß,
JumperII
 
Werbung:
Z.B. die der "functions_user.php" die Du dort eingebunden hast? Ansonsten würde auch ich dir dringen empfehlen selbst richtig zu debuggen. Bei einem Umzug von Server 1 zu Server 2 ändert sich immer die Umgebung des Scripts. Da muss man zwangsläufig etwas ändern.
 
da ist noch eine CAPTCHA_K313 CAPTCHA_K313, created: 0.0015 sec.
(wegen werbung "reload" klicken)
bild.php


 
Werbung:
Zurück
Oben