Incorrect result

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


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('`&lt;(code|url|img)&gt;(.+?)&lt;/&gt;`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>';

you can see the result here:

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


Re: Incorrect result

collinm wrote:
Quoted text here. Click to load it

I can't see any output but the default headers. When you are using bits in
this page which *should* display, there's probably a syntax error somewhere.
Check your error logs in this case.


Site Timeline