damit melder der immer
Code:
else {
echo "Error! Kein Name, Eintrag oder keine E-Mail Adresse eingegeben";
}
und register_global is off -.-
liegt das daran?
Kann man das sich aktivieren lassen?
EDIT: Ich habe jetzt das ganze Script angepasst aber der Eintrag wird immer noch nicht abgesendet
PHP-Code:
<?php
include( "config.php" );
if(isset( $_POST [ 'submit' ])) {
if ( $_POST [ 'name' ] != "" && $_POST [ 'email' ] != "" && $_POST [ 'eintrag' ] != "" )
{
$_POST [ 'eintrag' ] = nl2br ( $_POST [ 'eintrag' ]);
/* Schutz vor Java Script */
$_POST [ 'eintrag' ] = str_replace ( "<script type=\"text/" , "Ich bin ein doof ich will hier Scripts reinbringen <!--" , $_POST [ 'eintrag' ]);
$_POST [ 'eintrag' ] = str_replace ( "<script>" , "Ich bin ein •••••••••, ich will hier Scripts reinbringen <!--" , $_POST [ 'eintrag' ]);
$_POST [ 'eintrag' ] = str_replace ( "type=\"javascript\"" , "ich bin so ein Drecks••••••••• <!--" , $_POST [ 'eintrag' ]);
$_POST [ 'eintrag' ] = str_replace ( "</script>" , "-->Ich will Scripts einsetzen und bin ein Drecks•••••••••" , $_POST [ 'eintrag' ]);
/* Ende Schutz vor Java Script */
/* Schutz vor HTML */
$nohtml = "<b>Kein HTML erlaubt</b>" ;
$_POST [ 'eintrag' ] = str_replace ( "<span" , $nohtml , $_POST [ 'eintrag' ]);
$_POST [ 'eintrag' ] = str_replace ( "style=" , $nohtml , $_POST [ 'eintrag' ]);
$_POST [ 'eintrag' ] = str_replace ( "<style" , $nohtml , $_POST [ 'eintrag' ]);
$_POST [ 'eintrag' ] = str_replace ( "<table" , $nohtml , $_POST [ 'eintrag' ]);
$_POST [ 'eintrag' ] = str_replace ( "<div" , $nohtml , $_POST [ 'eintrag' ]);
$_POST [ 'eintrag' ] = str_replace ( "<a" , $nohtml , $_POST [ 'eintrag' ]);
$_POST [ 'eintrag' ] = str_replace ( "border=" , $nohtml , $_POST [ 'eintrag' ]);
$_POST [ 'eintrag' ] = str_replace ( "<img" , $nohtml , $_POST [ 'eintrag' ]);
/* Ende Schutz vor HTML */
$gbook_insert = "INSERT INTO `gbook` (name, eintrag, email) VALUES ('" . $_POST [ 'name' ]. "', '" . $_POST [ 'eintrag' ]. "', '" . $_POST [ 'email' ]. "');" ;
echo mysql_error ();
//echo $gbook_insert;
$gbook_query = mysql_query ( $gbook_insert ) or die( mysql_error ());
header ( "location: gbook_view.php" );
}
else {
echo "Error! Kein Name, Eintrag oder keine E-Mail Adresse eingegeben" ;
}
}
?>
<form method="post">
<table border="1" width="50%" bgcolor="#CCCCCC">
<tr>
<td bgcolor="#000000" colspan="2"><font size="+2"><font color="#FFFFFF">Ins Gästebuch eintragen</font></font></td>
</tr>
<tr><td width="35%">
Name:</td><td width="35%"> <input name="name" type="text"><br>
</td></tr><tr><td>
E-Mail Adresse: </td><td> <input name="email" type="text"><br></td></tr><tr><td colspan="2">
Text:<br><textarea name="eintrag" cols="80" rows="15"></textarea></td></tr><tr><td colspan="2" align="center">
<input name="submit" type="submit" value="Absenden"></td></tr></table>
</form>