hi ich bräuchte bitte eure hilfe beim einfügen eines captchas
cih habe es von dieser seite: Zahlen Captcha PHP Script - Captcha Tutorial - stoppt-den-spam.info
captcha.php,bild und schriftart liegen wie im tuto vorgeschlagen in nem captcha ordner
habe eigentlich alles wie dort beschrieben eingefügt aber es kommt folgende fehlermeldung:
Parse error: syntax error, unexpected $end in /www/htdocs/v078534/kunden/form/dialog/kontakt/index.php on line 259
hier die captcha.php:
PHP-Code:
<?php
session_start();
unset($_SESSION['captcha_spam']);
function randomString($len) {
function make_seed(){
list($usec , $sec) = explode (' ', microtime());
return (float) $sec + ((float) $usec * 100000);
}
srand(make_seed());
//Der String $possible enthält alle Zeichen, die verwendet werden sollen
$possible="ABCDEFGHJKLMNPRSTUVWXYZabcdefghijkmnpqrstuvwxyz23456789";
$str="";
while(strlen($str)<$len) {
$str.=substr($possible,(rand()%(strlen($possible))),1);
}
return($str);
}
$text = randomString(5); //Die Zahl bestimmt die Anzahl stellen
$_SESSION['captcha_spam'] = $text;
header('Content-type: image/png');
$img = ImageCreateFromPNG('captcha.PNG'); //Backgroundimage
$color = ImageColorAllocate($img, 0, 0, 0); //Farbe
$ttf = $_SERVER['DOCUMENT_ROOT']."/captcha/XFILES.TTF"; //Schriftart
$ttfsize = 25; //Schriftgrösse
$angle = rand(0,5);
$t_x = rand(5,30);
$t_y = 35;
imagettftext($img, $ttfsize, $angle, $t_x, $t_y, $color, $ttf, $text);
imagepng($img);
imagedestroy($img);
?>
und hier nun das betreffende formular
PHP-Code:
<html>
<head>
<title>xxx</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../../css/global.css">
<script language="JavaScript" src="../../jscript/global.js" type="text/javascript"></script>
</head>
<body bgcolor="#FFFFFF">
<center>
<? include ('../../includes/global/head.inc'); ?>
<table width="740" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/trans.gif" width="1" height="1"></td>
</tr>
</table>
<table width="740" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="140" bgcolor="#12327D" valign="top" align="center"><br>
<br>
<? include ('../../includes/global/navi_dialog.inc'); ?></td>
<td width="460" align="center" valign="top"> <br>
<form method="post" action="index.php">
<br>
<table width="402" border="0" cellspacing="0" cellpadding="0" height="22">
<tr bgcolor="#FFB900" align="center" valign="middle">
<td>
<table width="400" border="0" cellspacing="0" cellpadding="3" bordercolor="#FFB900" height="20">
<tr bgcolor="#FFFFFF">
<td class="text"> <b><font color="#12327D">Dialog</font>
- Kontaktformular </b></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<?php
session_start();
if(isset($_SESSION['captcha_spam']) AND $_POST["sicherheitscode"] == $_SESSION['captcha_spam']){
unset($_SESSION['captcha_spam']);
if( isset($_POST['send']))
{
$error = 0;
if( trim( strlen( $_POST['anrede'])) == 0)
{
echo ( "Bitte Ihre Anrede eintragen<br>");
$error = 1;
}
if( trim( strlen( $_POST['firma'])) == 0)
{
echo ( "Bitte Ihre Firma eintragen<br>");
$error = 1;
}
if( trim( strlen( $_POST['vorname'])) == 0)
{
echo ( "Bitte Ihren Namen eintragen<br>");
$error = 1;
}
if( trim( strlen( $_POST['name'])) == 0)
{
echo ( "Bitte Ihren Namen eintragen<br>");
$error = 1;
}
if( trim(strlen( $_POST['strasse'])) == 0)
{
echo ( "Bitte Ihre Straße eintragen<br>");
$error = 1;
}
if( trim( strlen( $_POST['ort'])) == 0)
{
echo ( "Bitte Ihren Ort eintragen<br>");
$error = 1;
}
if( trim( strlen( $_POST['plz'])) == 0)
{
echo ( "Bitte Ihre Postleitzahl eintragen<br>");
$error = 1;
}
if( trim( strlen( $_POST['telefon'])) == 0)
{
echo ( "Bitte Ihre Telefonnummer eintragen<br>");
$error = 1;
}
if( trim( strlen( $_POST['fax'])) == 0)
{
echo ( "Bitte Ihre Faxnummer eintragen<br>");
$error = 1;
}
if( trim( strlen( $_POST['email'])) == 0)
{
echo ( "Bitte Ihre Email Adresse eintragen<br>");
$error = 1;
}
if( trim( $_POST['strasse'] == $_POST['name']))
{
echo ( "Bitte geben Sie korrekte Daten ein.<br>");
$error = 1;
}
if($error == 0)
{
$empfaenger="xxx.de";
$betreff="Anfrageformular";
$admin="xxx.de";
$from ="Kontaktformular Kontakt";
$message = "Nachricht an " . $admin . " von " . $email ." :
\n\nKontaktformular"
. "\nFirma: " . $firma
. "\nAnrede: " . $select
. "\nName: " . $name
. "\nStrasse: " . $strasse
. "\nHausnummer: " . $hnr
. "\nOrt: " . $ort
. "\nPLZ: " . $plz
. "\nLand " . $land
. "\nTelefon: " . $telefon
. "\nFax: " . $fax
. "\nEmail: " . $email
. "\n\nNachricht: " . $nachricht;
mail($empfaenger,$betreff,$message,$from);
echo "<b>Vielen Dank für Ihre Nachricht</b>";
}
}
?>
<table width="402" border="0" cellspacing="3" cellpadding="2">
<tr>
<td height="28" align="left" valign="middle" class="text" width="150"> Firmenname:</td>
<td height="28" valign="middle" align="left" width="252">
<input type="text" size="25" name="firma" class="Formularfeld">
</td>
</tr>
<tr>
<td width="150" align="left" valign="middle" height="28" class="text"> Anrede:</td>
<td width="252" valign="middle" height="28" align="left">
<select name="anrede" size="1" class="Formularfeld">
<option>Herr</option>
<option>Frau</option>
</select>
</td>
</tr>
<tr>
<td width="150" align="left" valign="middle" class="text" height="28"> Name:</td>
<td width="252" valign="middle" align="left" height="28">
<input
type="text" size="25" name="name" class="Formularfeld">
</td>
</tr>
<tr>
<td width="150" align="left" valign="middle" class="text" height="28"> Vorname:</td>
<td width="252" valign="middle" align="left" height="28">
<input
type="text" size="25" name="vorname" class="Formularfeld">
</td>
</tr>
<tr>
<td width="150" align="left" valign="middle" class="text" height="28"> Straße:</td>
<td width="252" valign="middle" align="left" height="28">
<input
type="text" size="25" name="strasse" class="Formularfeld">
</td>
</tr>
<tr>
<td width="150" align="left" valign="middle" class="text" height="28"> Hausnummer
:</td>
<td width="252" valign="middle" align="left" height="28">
<input
type="text" size="25" name="hnr" class="Formularfeld">
</td>
</tr>
<tr>
<td width="150" align="left" valign="middle" class="text" height="28"> Postleitzahl:</td>
<td width="252" valign="middle" align="left" height="28">
<input
type="text" size="25" name="plz" class="Formularfeld">
</td>
</tr>
<tr>
<td width="150" align="left" valign="middle" class="text" height="28"> Ort:</td>
<td width="252" valign="middle" align="left" height="28">
<input
type="text" size="25" name="ort" class="Formularfeld">
</td>
</tr>
<tr>
<td width="150" align="left" valign="middle" class="text" height="28"> Land:</td>
<td width="252" valign="middle" align="left" height="28">
<input
type="text" size="25" name="land" class="Formularfeld">
</td>
</tr>
<tr>
<td width="150" align="left" valign="middle" class="text" height="28"> Telefon:</td>
<td width="252" valign="middle" align="left" height="28">
<input
type="text" size="25" name="telefon" class="Formularfeld">
</td>
</tr>
<tr>
<td width="150" align="left" valign="middle" class="text" height="28"> Fax:</td>
<td width="252" valign="middle" align="left" height="28">
<input
type="text" size="25" name="fax" class="Formularfeld">
</td>
</tr>
<tr>
<td width="150" align="left" valign="middle" class="text" height="28"> E-mail:</td>
<td width="252" valign="middle" align="left" height="28">
<input
type="text" size="25" name="email" class="Formularfeld">
</td>
</tr>
<tr>
<td width="150" align="left" valign="top" class="text"> Ihre
Nachricht:</td>
<td width="252" valign="top" align="left" >
<textarea name="nachricht" rows="8" cols="27" class="Formularfeld" wrap="VIRTUAL"></textarea>
</td>
</tr>
<tr>
<td><img src="captcha/captcha.php" border="0" title="Sicherheitscode"></td>
<td><input type="text" name="sicherheitscode" size="5"></td>
</tr>
<tr>
<td width="150" align="left" valign="middle" height="40"> </td>
<td width="252" valign="middle" align="left" height="40">
<input type="submit" name="send" value="Abschicken">
</td>
</table>
<br>
<br>
</form>
</td>
<td width="140" bgcolor="#12327D" align="center" valign="top"><br>
<br>
<? include ('../../includes/global/rechts1.inc'); ?><br>
<? include ('../../includes/global/rechts2.inc'); ?><br>
<? include ('../../includes/global/rechts3.inc'); ?> </td>
</tr>
</table>
<? include ('../../includes/global/foot_folge.inc'); ?>
</center>
</body>
</html>
ich hoffe also es erbarmt sich jemand und hilft mir dabei weiter
lg Li