[php] bbcode

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [php] bbcode

    Pls can any tell me how to do this bbcode
    [ php ] code here [ /php ]
    have connected with http://adexchat.com ?
    Fun up with
    http://forum.adexchat.com

    #2
    PHP Code:
    $string preg_replace('#\[php\](.*?)\[\/php\]#se'"'<div>' . highlight_string(stripslashes('$1'), true) . '</div>'"$string); 
    where $string is your input string (forum post for example)..

    Comment


      #3
      Thanks you!
      have connected with http://adexchat.com ?
      Fun up with
      http://forum.adexchat.com

      Comment


        #4
        Originally posted by milomir View Post
        PHP Code:
        $string preg_replace('#\[php\](.*?)\[\/php\]#se'"'<div>' . highlight_string(stripslashes('$1'), true) . '</div>'"$string); 
        where $string is your input string (forum post for example)..
        not working
        have connected with http://adexchat.com ?
        Fun up with
        http://forum.adexchat.com

        Comment


          #5
          \\1
          PHP Code:
          $string preg_replace('#\[php\](.*?)\[\/php\]#se'"'<div>' . highlight_string(stripslashes('\\1'), true) . '</div>'"$string); 
          Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
          Visit: WapMasterz Coming Back Soon!
          _______
          SCRIPTS FOR SALE BY SUBZERO
          Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
          FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
          _______
          Info & Tips
          php.net
          w3schools.com

          Comment


            #6
            $super="something else";
            echo "thank you $super";
            Added after 2 minutes:
            What can i use to prevent my post so not to hack by hacker with this bbcode
            Last edited by adex3g; 22.03.11, 15:13.
            have connected with http://adexchat.com ?
            Fun up with
            http://forum.adexchat.com

            Comment


              #7
              i dont know where my post went to in this topic lol
              $1 is the same as \\1 just depends on what php editor you use
              also the " " at the start and end of the replacement need removing
              eg:
              PHP Code:
              $string preg_replace('#\[php\](.*?)\[\/php\]#se''<div>' highlight_string(stripslashes('$1'), true) . '</div>'$string);

              //some text here to get rid of opera bug and this forum :/ 
              you may also need to do string replacements on <br /> to ""
              and htmlspecialchars_decode() if you have already used htmlspecialchars()

              Originally posted by adex3g View Post
              $super="something else";
              echo "thank you $super";
              Added after 2 minutes:
              What can i use to prevent my post so not to hack by hacker with this bbcode
              Providing it is used properly then any html inserted into the [ php] tags should not get executed by the browser
              Last edited by metulj; 15.04.12, 07:12.

              Comment

              Working...
              X