Page 1 of 1

Disable HTML in Guestbook entries.

Posted: Fri Sep 06, 2002 6:28 am
by Skywalker
How can I disable hmtl in my geustbook, because they are using redireckt html codes to redirect my guestbook page.

This is my php script that submites the inserted text out of the form to the database.

Can sombody please help me with this.


$Host = 'localhost';
$Gebruiker = 'test';
$Wachtwoord = 'test';
$DBNaam = 'Bikkertje';
$TabelNaam = 'Nieuws';



//Hier worden de gegevens in de tabel gestopt

$Verbinding = mysql_connect ($Host,$Gebruiker,$Wachtwoord);
$Opdracht = " INSERT into $TabelNaam values ('0','$_POST[Name]','$_POST[Onderwerp]','$_POST[Message]' )";

if (mysql_db_query ($DBNaam, $Opdracht, $Verbinding) ) {
print ("<font face=\"verdana\" size=1 color=\"white\">De nieuws item is geposte<br></font>\n");


} else {
print ("<br>De nieuws item is niet geposte<br>\n");
}


mysql_close ($Verbinding);

?>

Posted: Fri Sep 06, 2002 6:32 am
by twigletmac
Try stripping all the tags from the message body:
http://www.php.net/manual/en/function.strip-tags.php

Mac

Posted: Fri Sep 06, 2002 6:32 am
by qads
htmlspecialchars($ver);

Posted: Fri Sep 06, 2002 6:54 am
by Skywalker
Ok thx guys it's already don :D