hier der code Test
- Code: Alles auswählen
<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" xml:lang="de" content="Verein, spanischen, Miniclub, Fremdsprachen, Kinder, Motivation, training, Wiesbaden">
<meta name="keywords" xml:lang="es" content="Wiesbaden, Club, asociación, familia, Infantil, actividades, guardería">
<meta name="description" content="Entre Amigos D.S.L.e.V. es una asociación creada en Diciembre de 2005, sin fundamentos de tipo político, religioso o comercial que fue creada por iniciativa de varias mujeres de Wiesbaden con la finalidad de acercar y fomentar las relaciones de cooperación.">
<meta name="author" content="J.B.P.M"/>
<link rel="shortcut icon" href="favicon.ico" />
<title>Entre Amigos Deutsch-Spanisch-Lateinamerikanischer e. V.</title>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<link href="Scripts/css-estilos.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="870" height="45" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
<!--DWLayoutTable-->
<tr>
<th height="15" colspan="3" scope="col"><div align="center"><img src="images/general/cabeza0.gif" width="870" height="15" align="baseline" /></div></th>
</tr>
<tr>
<td width="15" background="images/general/links.gif"></td>
<td width="840"><div align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<th scope="col"><table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<tr>
<th width="14%" scope="col"><img src="images/general/ea.jpg" alt="logo" width="115" height="115" /></th>
<th width="86%" scope="col"><img src="images/general/entre_amigos_cabeza.gif" alt="logo1" width="700" height="115" /></th>
</tr>
</table></th>
</tr>
<tr>
<th scope="col"> </th>
</tr>
<tr>
<th height="113" scope="col"><table width="100%" height="103" border="0" cellpadding="0" cellspacing="0" bgcolor="#E8E5DF">
<tr>
<th height="39" scope="col"><table width="100%" height="40" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="104" background="images/general/fondomenu.gif" scope="col"><a href="index_es.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('inicio','','images/general/boton_02_inicio.gif',1)"><img src="images/general/boton_01_inicio.gif" title="Inicio" alt="inicio" name="inicio" width="100" height="37" border="0" id="inicio" /></a></th>
<th width="104" background="images/general/fondomenu.gif" scope="col"><a href="es/asociacion.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('elclub','','images/general/boton_02_asociacion.gif',1)"><img src="images/general/boton_01_asociacion.gif" title="asociacion" alt="asociacion" name="elclub" width="100" height="37" border="0" id="elclub" /></a></th>
<th width="104" background="images/general/fondomenu.gif" scope="col"><a href="es/novedades.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('novedades','','images/general/boton_02_novedades.gif',1)"><img src="images/general/boton_01_novedades.gif" title="novedades" alt="novedades" name="novedades" width="100" height="37" border="0" id="novedades" /></a></th>
<th width="104" background="images/general/fondomenu.gif" scope="col"><a href="es/actividades.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('actividades','','images/general/boton_02_actividades.gif',1)"><img src="images/general/boton_01_actividades.gif" title="actividades" alt="actividades" name="actividades" width="100" height="37" border="0" id="actividades" /></a></th>
<th width="104" background="images/general/fondomenu.gif" scope="col"><a href="es/fotos.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('fotos','','images/general/boton_02_fotos.gif',1)"><img src="images/general/boton_01_fotos.gif" title="fotos" alt="fotos" name="fotos" width="100" height="37" border="0" id="fotos" /></a></th>
<th width="104" background="images/general/fondomenu.gif" scope="col"><a href="es/enlaces.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('enlaces','','images/general/boton_02_enlaces.gif',1)"><img src="images/general/boton_01_enlaces.gif" title="enlaces" alt="enlaces" name="enlaces" width="100" height="37" border="0" id="enlaces" /></a></th>
<th width="104" background="images/general/fondomenu.gif" scope="col"><a href="es/site_es.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image10','','images/general/boton_02_site.gif',1)"><img src="images/general/boton_01_site.gif" title="site map" alt="site map" name="Image10" width="100" height="37" border="0" id="Image10" /></a></th>
<th width="104" background="images/general/fondomenu.gif" scope="col"><a href="libro.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image11','','images/general/boton_01_libro.gif',1)"><img src="images/general/boton_02_libro.gif" title="Gästebuch" alt="Gästebuch" name="Image11" width="100" height="37" border="0" id="Image11" /></a></th>
<th background="images/general/fondomenu.gif" scope="col"> </th>
</tr>
</table> </th>
</tr>
<tr>
<th scope="col"> </th>
</tr>
<tr>
<th scope="col"> </th>
</tr>
<tr>
<th scope="col"><table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<th scope="col"><div align="left">
<p>
<?php
function gbpostVars($myKey) {
// Holt Post-Vars
global $HTTP_POST_VARS;
if (isset($HTTP_POST_VARS[$myKey])) {
if (get_magic_quotes_gpc()) {
return (stripslashes($HTTP_POST_VARS[$myKey]));
} else {
return ($HTTP_POST_VARS[$myKey]);
}
}
else {
return ("");
}
}
function gbNLBR($text) {
$text=htmlentities($text);
$text=str_replace("\n","<br>",$text);
$text=str_replace("\r","",$text);
return ($text);
}
function gbgetVars($myKey) {
// Holt Get-Vars
global $HTTP_GET_VARS;
if (isset($HTTP_GET_VARS[$myKey])) {
if (get_magic_quotes_gpc()) {
return (stripslashes($HTTP_GET_VARS[$myKey]));
} else {
return ($HTTP_GET_VARS[$myKey]);
}
}
else {
return ("");
}
}
function gbServerVars($myKey) {
// Holt Server-Vars
global $HTTP_SERVER_VARS;
if (isset($HTTP_SERVER_VARS[$myKey])) {
return ($HTTP_SERVER_VARS[$myKey]);
}
else {
return ("");
}
}
function gbfwritePad($fp,$myVar,$length) {
// Schreibt gepadded in Datei
fwrite($fp,$myVar.str_repeat(" ",$length),$length);
}
function gbfgetPad($fp,$length) {
// Liest gepaddete Daten
return rtrim(fread($fp,$length));
}
function gbformatText($text) {
// Ersetzt BB-Formate
$text=str_replace("[i]","<i>",$text);
$text=str_replace("[/i]","</i>",$text);
$text=str_replace("[b]","<b>",$text);
$text=str_replace("[/b]","</b>",$text);
$text=str_replace(":)"," <img src=dgbsmile.gif border=0> ",$text);
$text=str_replace(";)"," <img src=dgbwink.gif border=0> ",$text);
$text=str_replace(":eek:"," <img src=dgbeek.gif border=0> ",$text);
$text=str_replace(":("," <img src=dgbsad.gif border=0> ",$text);
$text=str_replace(":o"," <img src=dgbwow.gif border=0> ",$text);
$text=str_replace(":roll:"," <img src=dgbroll.gif border=0> ",$text);
$text=str_replace(":lol:"," <img src=dgblol.gif border=0> ",$text);
$text.="</i></b>";
return($text);
}
$filename="./plugindata/061165.dat";
$maxpage=6;
$admin=0;
// Daten schreiben
if (gbgetVars("action")=="post") {
$pos=0;
// Position ermitteln
if (!file_exists($filename)) {
// Neue Datei
$fp=fopen($filename,"w");
flock ($fp,2);
gbfwritePad($fp,1,6);
flock ($fp,3);
fclose($fp);
$pos=1;
$fp=fopen($filename,"r+");
flock ($fp,2);
} else {
// Anhängen
$fp=fopen($filename,"r+");
flock ($fp,2);
$pos=gbfgetPad($fp,6);
$pos++;
fseek($fp,0);
gbfwritePad($fp,$pos,6);
}
// Schreiben
fseek($fp,6+($pos-1)*4890);
if ($admin) {
gbfwritePad($fp,0,1);
} else {
gbfwritePad($fp,1,1);
}
gbfwritePad($fp,gbServerVars("REMOTE_ADDR"),15);
gbfwritePad($fp,gbpostVars("username"),256);
gbfwritePad($fp,substr(gbNLBR(gbpostVars("message")),0,4096),4096);
gbfwritePad($fp,gbpostVars("email"),256);
gbfwritePad($fp,gbpostVars("www"),256);
gbfwritePad($fp, date("d.m.Y"),10);
flock ($fp,3);
fclose($fp);
// Benutzerinterface
echo("<p>Muchas gracias por su inscripción en nuestro Libro de Visitas. Nos alegramos por cada visitante y tomamos en serio mucho las críticas y sugerencias.<br>\n");
echo("<p>Vielen Dank für Ihren Eintrag in unser Gästebuch. Wir freuen uns über jeden Besucher und nehmen Kritik und Anregungen sehr ernst.<br><br>\n");
echo("<a class='s2d' href='libro.php'>Visualizar el Libro de Visitas<br>Das Gästebuch anzeigen</a></p>\n");
}
if (gbgetVars("action")=="") {
// Anzeigen
$displaycount=0;
if (file_exists($filename)) {
$fp=fopen($filename,"r");
flock ($fp,1);
$recordcount=gbfgetPad($fp,6);
$first=gbgetVars("offset");
if ($first==0) {
$first=1;
};
$last=$first+$maxpage-1;
for ($i=1; $i<=$recordcount; $i++) {
fseek($fp,6+($recordcount-$i)*4890);
$view=gbfgetPad($fp,1);
gbfgetPad($fp,15);
if ($view==1) {
$displaycount++;
if ($i>=$first && $i<=$last) {
$username=gbfgetPad($fp,256);
$message=gbfgetPad($fp,4096);
$email=gbfgetPad($fp,256);
$www=gbfgetPad($fp,256);
$date=gbfgetPad($fp,10);
echo("<p>");
echo("<b>$date</b> - ");
if ($email=="") {
echo(htmlentities($username));
} else {
echo("<a class='s2d' href='mailto:$email'>");
echo(htmlentities($username));
echo("</a>\n");
}
if ($www!="") {
if (substr($www,0,7)!="http://") {
$wwwplus="http://".$www;
} else {
$wwwplus=$www;
}
echo(" <a class='s2d' href='$wwwplus'>");
echo("(".htmlentities($www).")");
echo("</a>\n");
}
echo("<br>\n");
echo(gbformatText($message)."</p>\n");
}
}
}
flock ($fp,3);
fclose ($fp);
}
// Navigation
echo("<p>\n");
echo("<a class='s2d' href='libro.php?action=form'>Haga clic aquí para escribir sus comentarios<br>Hier klicken, um einen Eintrag zu schreiben</a><br>\n");
if ($displaycount!=0) {
if ($first>1) {
print "<a class='s2d' href='libro.php?offset=".($first-$maxpage)."'>Atrás Zurück</a> ";
};
$page=0;
if ($displaycount>$maxpage) {
for ($i=1;$i<=$displaycount;$i=$i+$maxpage) {
$page++;
if ($i==$first) {
print " <strong>$page</strong> ";
} else {
print "<a class='s2d' href='libro.php?offset=".$i."'>$page</a> ";
}
}
}
if ($displaycount>$last) {
print "<a class='s2d' href='libro.php?offset=".($first+$maxpage)."'>Siguiente Weiter</a> ";
}
}
echo("</p>\n");
}
if (gbgetVars("action")=="form") { ?>
<script language="JavaScript">
var gbisbold;
var gbisitalic;
function gbStoreCaret(textEl) {
if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}
function gbemoti(code) {
document.gbpostform.message.focus();
if (document.gbpostform.message.createTextRange && document.gbpostform.message.caretPos) {
document.gbpostform.message.caretPos.text=code;
gbStoreCaret(document.gbpostform.message);
} else {
document.gbpostform.message.value+=(" "+code+" ");
}
}
function gbmakebold() {
document.gbpostform.message.focus();
if (document.gbpostform.message.createTextRange && document.gbpostform.message.caretPos) {
mySelection=document.gbpostform.message.caretPos.text;
if (mySelection) {
document.gbpostform.message.caretPos.text="[b]"+mySelection+"[/b]";
document.gbpostform.message.focus();
gbStoreCaret(document.gbpostform.message);
} else {
if (gbisbold) {
document.gbpostform.message.caretPos.text='[/b]';
gbisbold=false;
} else {
document.gbpostform.message.caretPos.text='[b]';
gbisbold=true;
}
gbStoreCaret(document.gbpostform.message);
}
} else {
if (gbisbold) {
document.gbpostform.message.value+='[/b]';
gbisbold=false;
} else {
document.gbpostform.message.value+='[b]';
gbisbold=true;
}
}
}
function gbmakeitalic() {
document.gbpostform.message.focus();
if (document.gbpostform.message.createTextRange && document.gbpostform.message.caretPos) {
mySelection=document.gbpostform.message.caretPos.text;
if (mySelection) {
document.gbpostform.message.caretPos.text="[i]"+mySelection+"[/i]";
document.gbpostform.message.focus();
gbStoreCaret(document.gbpostform.message);
} else {
if (gbisitalic) {
document.gbpostform.message.caretPos.text='[/i]';
gbisitalic=false;
} else {
document.gbpostform.message.caretPos.text='[i]';
gbisitalic=true;
}
gbStoreCaret(document.gbpostform.message);
}
} else {
if (gbisitalic) {
document.gbpostform.message.value+='[/i]';
gbisitalic=false;
} else {
document.gbpostform.message.value+='[i]';
gbisitalic=true;
}
}
}
function gbvalidate() {
var pattern=/.*\@.*\..*/;
if (document.gbpostform.username.value=="") {
document.gbpostform.username.focus();
document.gbpostform.username.select();
alert ("Bitte geben Sie Ihren Namen an.");
return(false);
}
if ((pattern.test(document.gbpostform.email.value))==false) {
document.gbpostform.email.focus();
document.gbpostform.email.select();
alert ("Bitte geben Sie eine gültige E-Mail-Adresse ein.");
return(false);
}
if (document.gbpostform.message.value=="") {
document.gbpostform.message.focus();
document.gbpostform.message.select();
alert ("Bitte geben Sie Ihre Nachricht ein.");
return(false);
}
if (document.gbpostform.message.value.length>4096) {
document.gbpostform.message.focus();
document.gbpostform.message.select();
alert ("Die eingegebene Nachricht ist zu lang. Bitte geben Sie eine kürzere Nachricht ein.");
return(false);
}
document.gbpostform.submit;
}
</script>
<?php
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"], "8h384ls94");
$sicherheits_eingabe = str_replace("=", "", $sicherheits_eingabe);
if(isset($_SESSION['captcha_spam']) AND $sicherheits_eingabe == $_SESSION['captcha_spam']){
unset($_SESSION['captcha_spam']);
?>
<form onSubmit="return gbvalidate()" action="libro.php?action=post" method="post" name="gbpostform">
<table width="593" align="center">
<tr>
<td width="122" class='s2d'><div align="right">Name:</div></td><td width="459" class='s2d'><input style="width: 340px;" class='s2d' type="text" name="username" maxlength="255"><br></td>
</tr>
<tr>
<td class='s2d'><div align="right">E-Mail:</div></td><td class='s2d'><input style="width: 340px;" class='s2d' type="text" name="email" maxlength="255"><br>
</tr>
<tr>
<td class='s2d'><div align="right">WWW:</div></td><td class='s2d'><input style="width: 340px;" class='s2d' type="text" name="www" maxlength="255"><br>
</tr>
<tr>
<td class='s2d' valign="top"><div align="right">Eintrag:</div></td><td class='s2d'><textarea style="width: 340px;" cols="40" rows="10" name="message" onSelect="gbStoreCaret(this);" onClick="gbStoreCaret(this);" onKeyUp="gbStoreCaret(this);"></textarea><br>
</tr>
<tr>
<td colspan="2" valign="top" class='s2d'><div align="center"><a class='s2d' href="javascript:gbemoti(':)')"><img src="dgbsmile.gif" width="15" height="15" border="0" alt="" /></a> <a class='s2d' href="javascript:gbemoti(';)')"><img src="dgbwink.gif" width="15" height="15" border="0" alt="" /></a> <a class='s2d' href="javascript:gbemoti(':eek:')"><img src="dgbeek.gif" width="15" height="15" border="0" alt="" /></a> <a class='s2d' href="javascript:gbemoti(':(')"><img src="dgbsad.gif" width="15" height="15" border="0" alt="" /></a> <a class='s2d' href="javascript:gbemoti(':o')"><img src="dgbwow.gif" width="15" height="15" border="0" alt="" /></a> <a class='s2d' href="javascript:gbemoti(':roll:')"><img src="dgbroll.gif" width="15" height="15" border="0" alt="" /></a> <a class='s2d' href="javascript:gbemoti(':lol:')"><img src="dgblol.gif" width="15" height="15" border="0" alt="" /></a></div></td>
</tr>
<tr>
<td colspan="2" valign="top" class='s2d'><div align="center"><a class='s2d' href="javascript:gbmakebold()">Negrita fett</a> <a class='s2d' href="javascript:gbmakeitalic()">Cursiva kursiv</a></div></td>
</tr>
<tr>
<td height="20" colspan="2" valign="top" class='s2d'> </td>
</tr>
<tr>
<td><img src="captcha/captcha.php" border="0" title="Sicherheitscode"></td>
<td><input type="text" name="sicherheitscode" size="4"></td>
</tr>
<tr>
<td height="20" colspan="2" valign="top" class='s2d'> </td>
</tr>
<tr>
<td colspan="2" valign="top" class='s2d'><div align="center">
<input name="image" type="image" title="Guardar Speichern" src="images/Boton_Libro.gif" alt="Guardar Speichern" align="middle" border="0" />
</div></td>
</tr>
</table>
<tr>
<td></td>
<td class='s2d'>
</td>
</tr>
<tr>
<td></td>
<td class='s2d' align="right"> </td>
</form>
</tr>
<?php } }?>
</p>
</div></th>
</tr>
</table></th>
</tr>
<tr>
<th scope="col"><table width="100%" height="37" border="0" cellpadding="0" cellspacing="0">
<tr>
<th background="images/general/fondomenu_pie.gif" scope="col"> </th>
</tr>
</table></th>
</tr>
</table></th>
</tr>
<tr>
<th colspan="2" class="Stil15" scope="col"><div align="right">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="55%" scope="col"><div align="right"><span class="Stil16">© 2006 Design by</span></a></span></a></div></th>
<th width="45%" scope="col"><div align="left">
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','26','height','19','title','E-mail','src','images/general/email','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','images/general/email' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="26" height="19" title="E-mail">
<param name="movie" value="images/general/email.swf" />
<param name="quality" value="high" />
<embed src="images/general/email.swf" width="26" height="19" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
</object>
</noscript>
</div></th>
</tr>
</table>
</div><div align="left"></div></th>
</tr>
</table>
</div></td>
<td width="15" background="images/general/rechts.gif"></td>
</tr>
<tr>
<td height="15" colspan="3" background="images/general/pie.gif"></td>
</tr>
</table>
</body>
</html>
