Dr Dau
ich wisch hier durch
Was denn?!schiese hat gesagt.:Ich habe nichts geschrieben![]()

Ich lasse die Erklärung trotzdem stehen...... könnte andern ja helfen.

Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
Was denn?!schiese hat gesagt.:Ich habe nichts geschrieben![]()
test <br />test <br />test
text<br />
<br>tet<br />
<br>test
<?php
include("functions.php");
$text=$_POST["text"];
$text=htmlentities($text);
$text=replacetags($text);
$text=nl2br($text);
$today = date('j-m-y, g:i a');
$datei = "GS/files/guestbook.master";
$rein = str_replace("\r\n","<br />", $text);
$fp = fopen($datei,"a");
fputs($fp,"$today|-|$name|-|$email|-|$homepage|-|$titelicon|-|$titel|-|$rein\n");
fclose($fp);
?>
include("functions.php");
$text = str_replace("\r\n","<br />",htmlentities(stripslashes($_POST['text'])));
$today = date('j-m-y, g:i a');
$datei = "GS/files/guestbook.master";
$fp = fopen($datei,"a");
$rein = $today."|-|".$name."|-|".$email."|-|".$homepage."|-|".$titelicon."|-|".$titel."|-|".$text."\r\n";
fputs($fp,$rein);
fclose($fp);
function replacetags($messagetext)
{
while ((strpos($messagetext,"[url=")>-1) && (strpos($messagetext,"[ /url ]")>-1))
{
$startpos=strpos($messagetext,"[url=")+5;
$endpos=strpos($messagetext,"]",$startpos);
$url=substr($messagetext,$startpos,$endpos-$startpos);
$startpos=$endpos+1;
$endpos=strpos($messagetext,"[ /url ]",$startpos);
$urltext=substr($messagetext,$startpos,$endpos-$startpos);
$codestring='[url='.$url.']'.$urltext.'[ /url ]';
$urlstring='<a href="'.$url.'" target="_blank">'.$urltext.'</a>';
$messagetext=str_replace($codestring,$urlstring,$messagetext);
}
while ((strpos($messagetext,"[color=")>-1) && (strpos($messagetext,"[ /color ]")>-1))
{
$startpos=strpos($messagetext,"[color=")+7;
$endpos=strpos($messagetext,"]",$startpos);
$color=substr($messagetext,$startpos,$endpos-$startpos);
$startpos=$endpos+1;
$endpos=strpos($messagetext,"[ /color ]",$startpos);
$colortext=substr($messagetext,$startpos,$endpos-$startpos);
$codestring='[color='.$color.']'.$colortext.'[ /color ]';
$colorstring='<font color="'.$color.'">'.$colortext.'</font>';
$messagetext=str_replace($codestring,$colorstring,$messagetext);
}
while ((strpos($messagetext,"[ b ]")>-1) && (strpos($messagetext,"[ /b ]")>-1))
{
$startpos=strpos($messagetext,"[ b ]")+3;
$endpos=strpos($messagetext,"[ /b ]",$startpos);
$text=substr($messagetext,$startpos,$endpos-$startpos);
$codestring='[ b ]'.$text.'[ /b ]';
$formatstring='<b>'.$text.'</b>';
$messagetext=str_replace($codestring,$formatstring,$messagetext);
}
while ((strpos($messagetext,"[ i ]")>-1) && (strpos($messagetext,"[ /i ]")>-1))
{
$startpos=strpos($messagetext,"[ i ]")+3;
$endpos=strpos($messagetext,"[ /i ]",$startpos);
$text=substr($messagetext,$startpos,$endpos-$startpos);
$codestring='[ i ]'.$text.'[ /i ]';
$urlstring='<i>'.$text.'</i>';
$messagetext=str_replace($codestring,$urlstring,$messagetext);
}
while ((strpos($messagetext,"[ u ]")>-1) && (strpos($messagetext,"[ /u ]")>-1))
{
$startpos=strpos($messagetext,"[ u ]")+3;
$endpos=strpos($messagetext,"[ /u ]",$startpos);
$text=substr($messagetext,$startpos,$endpos-$startpos);
$codestring='[ u ]'.$text.'[ /u ]';
$formatstring='<u>'.$text.'</u>';
$messagetext=str_replace($codestring,$formatstring,$messagetext);
}
while ((strpos($messagetext,"[ s ]")>-1) && (strpos($messagetext,"[ /s ]")>-1))
{
$startpos=strpos($messagetext,"[ s ]")+3;
$endpos=strpos($messagetext,"[/s ]",$startpos);
$text=substr($messagetext,$startpos,$endpos-$startpos);
$codestring='[ s ]'.$text.'[ /s ]';
$formatstring='<s>'.$text.'</s>';
$messagetext=str_replace($codestring,$formatstring,$messagetext);
}
return $messagetext;
}
Holy ****! Das sieht mir nach jeder Menge unnötiger Codeduplikation aus.Dennis Wronka hat gesagt.:replacetags() duerfte das hier sein:
PHP:function replacetags($messagetext) { /* sehr viel Code */ }
$trans = array(
chr(0x0A) => '\n',
chr(0x0C) => '\r',
chr(0x5C) => '\\\\'
);
// Zum Eintragen
$string = strtr($string, $trans);
// Zur Ausgabe
$string = strtr($string, array_flip($trans));