Du bist echt schlimm rolus!!!Ich wollte Toarus testen ob er das weiss was ich bezweifel.
Wieso machst du dir so viel arbeit?Erstmal kann man die Zeichen einfacher umwandeln (entschärfen)!Mach einfach so:
PHP-Code:
<?php session_start();
if (!(
$_SESSION['logged'])) header ('Location: login.php');
# MySQL
include ('global.inc.php');
$db->connect();
# Nachricht eintragen
if ($_POST['submit'] && !empty ($_POST['msg']))
{
    
$msg htmlspecialchars($_POST['msg']);
    
$msg '['.date('H:i').'] '.$_SESSION['user'].' // '.$_SESSION['char'].' <strong>&raquo;</strong> '.$msg;
    
$db->query ('INSERT INTO `chat` (`msg`, `userid`, `time`) VALUES ("'.$msg.'", "'.$_SESSION['userid'].'", UNIX_TIMESTAMP())');
?><!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 content="text/html; charset=iso-8859-1" http-equiv="content-type" />
  <title>ChatInput</title>
  <link href="style.css" rel="stylesheet" type="text/css" />

</head>
<body onload="document.input.msg.focus();">

  <form action="<?php echo ($_SERVER['PHP_SELF']); ?>" id="input" method="post" name="input">
  <strong class="symbol">&raquo;</strong> <input alt="Eingabefeld" class="input" id="msg" name="msg" style="width: 300px;" type="text" />
  <input alt="Absendebutton" class="input" id="submit" name="submit" style="width: 100px;" type="submit" value="Senden!" />
  </form>

</body>
</html>