#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Everywhere.
    Posts
    17
    Rep Power
    0

    PHP Highlighting


    Im trying to make a php syntax highlighter, within a tutorial i tried this:

    PHP Code:
    <?
    $Message 
    str_replace("<codebox>","<center><textarea cols='90' rows='8' class='ListBox' style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal'><?php show_source(\"",$Message);
    $Message str_replace("</codebox>","\"); ?></textarea></center>",$Message);
    ?>
    And it just echos:

    <?php show_source("
    Then the code in the tutorial
    then
    "); ?>

    Anyone know how to solve this, a million thank u's cos this finishes my website
  2. #2
  3. Retired
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2002
    Location
    Finland
    Posts
    9,115
    Rep Power
    2497
    This subject has been discussed over the past few days - try searching for some threads on the subject.

    I haven't tested this, but what about doing this to get your code:
    PHP Code:
    eval("?>".$Message); 
    HTH

    Cheers,
    Jamie

    >_ My Music Blog | Losing weight @notsoheavyblog | My Tweets

    __________________

    Let the might of your compassion arise to bring a quick end
    to the flowing stream of the blood and tears .....
    Please hear my anguished words of truth.

    __________________

IMN logo majestic logo threadwatch logo seochat tools logo