Incorrect result

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • collinm

    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_ca llback('`&lt;(c ode|url|img)&gt ;(.+?)&lt;/\1&gt;`si',
    'bbcode', htmlentities($s tr));
    $str = mysql_real_esca pe_string($str)

    my bbcode function:

    function bbcode($m) {
    switch($m[1]) {
    case 'code' :
    return '<div class="code"><p re>'.$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
  • Janwillem Borleffs

    #2
    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



    Comment

    Working...