text2html

raspi 12.12.01 06:44

Muunna teksti HTML muotoon

 Tekstiversio  Arvo: -8 (8 ääntä)  Äänestä: +  -
<html>
<head>
  <title>Text To HTML (c) raspi</title>
</head>
<body>
<form method="POST" action="text2html.php" enctype="application/x-www-form-urlencoded">
PRE: <input type="checkbox" name="p">
<br>
<textarea name="t" COLS=60 ROWS=10></textarea>
<br>
<input type="submit" value="Ok">
</form>
<hr>
<!-- alku -->
<?php
if (isset($t) && $t != "") {
  if ($p == "on") {$p = 1;}
  $t = stripslashes($t);
  $t = htmlentities($t);
  if ($p != 1) {$t = preg_replace("/(\015\012)|(\015)|(\012)/", "<br>\n", $t);}
  $t = str_replace(" ", "&nbsp;", $t);
  if ($p == 1) echo "<pre>\n";
  echo "$t\n";
  if ($p == 1) echo "</pre>\n";
}
?>
<!-- loppu -->
</body>
</html>

pekkajarvinen@kolumbus.fi

Whiz 13:18 27.10.02 
eh
Dex 01:09 12.12.04 
Siis TÄH?! Mikä tämän idea niin kuin on?! Kirjoittaa tekstiä ja se muuttaa sen html:ksi, missä EI ole mitään järkeä... Älytöntä!