Connecting Tech Pros Worldwide Help | Site Map

Incorrect result

  #1  
Old July 17th, 2005, 01:55 PM
collinm
Guest
 
Posts: n/a
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, 01:55 PM
Janwillem Borleffs
Guest
 
Posts: n/a

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



Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
incorrect result when converting from basic string to System::String Vivienne answers 1 August 20th, 2007 07:05 AM
String::CRC crc function returns incorrect result, why? `Zidane Tribal answers 1 July 28th, 2007 09:05 PM
Adding double values gives incorrect result swhite76@mapinfo.com answers 2 November 22nd, 2005 01:40 PM
Again: linking between C++ and Fortran results in incorrect result NM answers 13 September 17th, 2005 07:45 PM
Adding double values gives incorrect result swhite76@mapinfo.com answers 2 July 21st, 2005 05:33 PM