Disable HTML in Guestbook entries.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Skywalker
Forum Contributor
Posts: 117
Joined: Thu Aug 29, 2002 3:33 am
Location: The Netherlands

Disable HTML in Guestbook entries.

Post 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);

?>
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Try stripping all the tags from the message body:
http://www.php.net/manual/en/function.strip-tags.php

Mac
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

htmlspecialchars($ver);
User avatar
Skywalker
Forum Contributor
Posts: 117
Joined: Thu Aug 29, 2002 3:33 am
Location: The Netherlands

Post by Skywalker »

Ok thx guys it's already don :D
Post Reply