Connecting Tech Pros Worldwide Help | Site Map

Incorrect result

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:55 PM
collinm
Guest
 
Posts: n/a
Default Incorrect result

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

  #2  
Old July 17th, 2005, 12:55 PM
Janwillem Borleffs
Guest
 
Posts: n/a
Default Re: Incorrect result

collinm wrote:[color=blue]
> 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...
>[/color]

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.


JW



 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.