Hi,
Habe folgendes Problem.
Ich bastel gerade an nem kleinen gästebuch und habe das problem das er die captcha eingabe nicht berücksichtigt also is sozusagen noch nicht aktiv.
Mir fehlen bedingungen für die if else abfrage und ich weiss nicht welche.
Da ich noch nicht so lange php mache bitte ich euch um hilfe.
hier hab ich mal die ganze Datei.
PHP
<?php
session_start();
?>
<html>
<head>
<title>Gästebuch</title>
</head>
<body text="#FFFFFF" style="font-family: verdana; font-size: 11px;">
<center>
<?php
require_once 'TEXT/captcha.php';
$captcha = Text_CAPTCHA::factory('Image');
$options = array('font_size'=>'20',
'font_path'=>'./',
'font_file'=>'default.ttf');
$captcha->init(150, 50, NULL, $options);
$image = $captcha->getCAPTCHAAsJPEG();
$handle = fopen('captcha.jpg', 'w');
fwrite($handle, $image);
fclose($handle);
?>
<?php
$_SESSION['captcha_phrase'] = $captcha->getPhrase();
?>
<?php
if (isset($_POST['captcha_phrase'], $_SESSION['captcha_phrase']) &&
strlen($_SESSION['captcha_phrase']) == 0 &&
$_POST['captcha_phrase'] === $_SESSION['captcha_phrase'])
{
[color =RED] ///////////////////////////////////HIER DIE BEDINGUNG [/color]
}
else
{
[color =RED]///////////////////////////////////// HIER DIE BEDINGUNG[/color]
}
?>
<form action="eintrag-einfuegen.php" method="post">
<table border="0" cellpadding="3" cellspacing="1" bgcolor="#111">
<tr>
<td colspan="2" bgcolor="#333333" align="center">[b]Gästebuch[/b]</td>
</tr>
<tr>
<td bgcolor="#333333" >Dein Name:</td>
<td bgcolor="#FF4400" ><input type="text" size="33" name="Name" style="font-family: verdana; font-size: 11px;" /></td>
</tr>
<tr>
<td bgcolor="#333333">Deine Titel:</td>
<td bgcolor="#FF4400"><input type="text" size="33" name="Titel" style="font-family: verdana; font-size: 11px;" /></td>
</tr>
<td bgcolor="#333333" valign="top">Eintrag:</td>
<td bgcolor="#FF4400"><textarea name="Eintrag" rows="5" cols="30" style="font-family: verdana; font-size: 11px;"></textarea></td>
</tr>
<tr>
<td bgcolor="#333333" valign="top">Code:</td>
<td bgcolor="#FF4400"><input type="text" name="captcha_phrase" />
[img]captcha.jpg[/img]
</tr>
<tr>
<tr>
<td colspan="2" bgcolor="#333333" align="center"><input type="submit" value="Eintragen!" style="font-family: Verdana; font-size: 11px;" /></td>
</tr>
</table>
</form></center>
</body>
</html>
<?php
?>
Alles anzeigen