Incorrect result
- From: collinm@xxxxxxxxxxxxxxxx (collinm)
- Date: 29 Apr 2005 13:06:57 -0700
hi
i try to insert a text in a database (mysql)
in this text, there are php code i want to display... i use
<code>...</code> to do this job
str = $_POST['texttutoriel'];
$str = preg_replace_callback('`<(code|url|img)>(.+?)</\1>`si',
'bbcode', htmlentities($str));
$str = mysql_real_escape_string($str)
my bbcode function:
function bbcode($m) {
switch($m[1]) {
case 'code' :
return '<div class="code"><pre>'.$m[2].'</pre></div>';
break;
//...
}
}
you can see the result here: http://www.laboiteaprog.com/tutoriel60-2
the part where i use <code> </code>... is ok, you can see it... the
rest of the text is not interpreted by the web navigator...
any idea
thanks
.
- Follow-Ups:
- Re: Incorrect result
- From: Janwillem Borleffs
- Re: Incorrect result
- Prev by Date: Re: output_handler problem
- Next by Date: MySQLi group
- Previous by thread: Where is my mind ?
- Next by thread: Re: Incorrect result
- Index(es):