Hoi.,
Ik heb deze code aan de hand van mijn vorige topic geschreven:
Probeer maar eens, zet hem op je server, start index.php, en type in de textarea het volgende:
Zonder die _ bij [PHP ], omdat got dat niet aankan!
Je zal zien dat hij dit laat zien:
----------------(lijntje)---------
<?php
echo "test\\";
?>
----------------(lijntje)---------

je ziet dus dat hij bij echo "test\\"; 2 slashes toevoegt
Waarom doed hij dit?? Heeft iemand enig idee??
Ik heb deze code aan de hand van mijn vorige topic geschreven:
PHP:
1
| <?if ($submit){ function highlight_php($input) { $input = stripslashes(trim($input)); ob_start(); @highlight_string($input); $output = ob_get_contents(); ob_end_clean(); $output = stripslashes($output); return $output; } function SourceOrginal($content, $type) { global $arr; if ($type == "php") { $content = highlight_php($content); } $hash = md5($content); $arr[$hash] = $content; $content = "[".$type."]".$hash."[/".$type."]"; return $content; } function SourceNew($hash, $type) { global $arr; if ($type == "php") { $naam = "PHP:"; } else { $naam = "Code:"; } $content = "<blockquote>$naam<hr><code>".$arr[$hash]."</code>[/quote]"; return $content; } $bericht = preg_replace("/\\[code\]((.|\n)*?)\\[\/code\]/ise", "SourceOrginal('\\1', 'code')", $bericht); $bericht = preg_replace("/\\[php\]((.|\n)*?)\\[\/php\]/ise", "SourceOrginal('\\1', 'php')", $bericht); $bericht = str_replace(":)", "[img]\"img/smile/blij.gif\"[/img]", $bericht); $bericht = preg_replace("/\\[code\]((.|\n)*?)\\[\/code\]/ise", "SourceNew('\\1', 'code')", $bericht); $bericht = preg_replace("/\\[php\]((.|\n)*?)\\[\/php\]/ise", "SourceNew('\\1', 'php')", $bericht); echo $bericht;}else{ echo "<form action='$PHP_SELF' method='post'>"; echo "<textarea name='bericht' rows='15' cols='40'></textarea>"; echo "<input type='submit' name='submit' value='Verzenden'>";}?> |
Probeer maar eens, zet hem op je server, start index.php, en type in de textarea het volgende:
Zonder die _ bij [PHP ], omdat got dat niet aankan!
code:
1
2
3
4
5
6
7
| :):) [_php] <?php echo "test"; ?> [/php_] :):) |
Je zal zien dat hij dit laat zien:
----------------(lijntje)---------
<?php
echo "test\\";
?>
----------------(lijntje)---------
je ziet dus dat hij bij echo "test\\"; 2 slashes toevoegt
Waarom doed hij dit?? Heeft iemand enig idee??