Custom PHP Tags

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    I don't even know azaidi is offline
    MemberRank
    Apr 2010 Join Date
    the NetherlandsLocation
    2,065Posts

    happy Custom PHP Tags

    I was messing around with some code, and made this:

    PHP Code:
    <?php
    class Php
    {
        private 
    $left;

        function 
    __construct()
        {
            
    ob_start();
        }

        function 
    __destruct()
        {
            
    $this->left ob_get_contents();
            
    ob_end_clean();

            while(
    true)
            {
                
    $start explode('{php}'$this->left2);

                echo 
    $start[0];

                if(!isset(
    $start[1]))
                {
                    break;
                }

                
    $end explode('{/php}'$start[1], 2);

                if(!isset(
    $end[1]))
                {
                    exit(
    'No closing tag {/php} found!');
                }

                eval(
    $end[0]);
                
    $this->left $end[1];
            }
        }
    }

    $php = new Php();
    ?>
    Include/require it on a page and you can use {php} {/php} tags
    Warning: it uses eval


  2. #2
    Member Nevara is offline
    MemberRank
    Jun 2012 Join Date
    83Posts

    Re: Custom PHP Tags

    it's great to be in first comment! and is this compatible with HabboPHP and PhoenixPHP?

  3. #3
    I don't even know azaidi is offline
    MemberRank
    Apr 2010 Join Date
    the NetherlandsLocation
    2,065Posts

    Re: Custom PHP Tags

    It's just some standard script I just wrote, I want to share it with the community ;)
    Just including it should work on most cms' but I don't know if it will work with a template system because it uses ob_start etc

  4. #4
    Make a wish .::Arjan::. is offline
    MemberRank
    Jan 2012 Join Date
    the NetherlandsLocation
    504Posts

    Re: Custom PHP Tags

    Nice AmirZ i give you a like :)

  5. #5
    Member HerrFreak is offline
    MemberRank
    Dec 2011 Join Date
    86Posts

    Re: Custom PHP Tags

    Looks good. :) Ill check it out later when Im back on my PC.

    Sent from my iPhone using Tapatalk

  6. #6
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: Custom PHP Tags

    Bad idea, eval is dangerous.

  7. #7
    I don't even know azaidi is offline
    MemberRank
    Apr 2010 Join Date
    the NetherlandsLocation
    2,065Posts

    Re: Custom PHP Tags

    Quote Originally Posted by Makarov View Post
    Bad idea, eval is dangerous.
    Tell me, how can you hack this

  8. #8
    hoi ik ben cool Merijn is offline
    MemberRank
    Dec 2009 Join Date
    The NetherlandsLocation
    492Posts

    Re: Custom PHP Tags

    Quote Originally Posted by Makarov View Post
    Bad idea, eval is dangerous.
    Possible, yes.

    But you can use eval(); for applications, and then it doesn't need to be malicous. It is malicous when you can use it in a $_POST, $_GET or whatever, but if you use it for applications it won't happen. It just, won't happen.

  9. #9
    Account Upgraded | Title Enabled! George2000 is offline
    MemberRank
    Jul 2011 Join Date
    The NetherlandsLocation
    1,150Posts

    Re: Custom PHP Tags

    Why we need custom PHP tags? Isn't <?php and ?> good?

  10. #10
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: Custom PHP Tags

    Quote Originally Posted by azaidi View Post
    Tell me, how can you hack this
    PHP: eval - Manual

  11. #11
    I don't even know azaidi is offline
    MemberRank
    Apr 2010 Join Date
    the NetherlandsLocation
    2,065Posts

    Re: Custom PHP Tags

    Quote Originally Posted by Makarov View Post
    This has nothing to do with user input cause YOU are making the php script and the user input is already filtered by your own script.

  12. #12
    Enthusiast NikeStix is offline
    MemberRank
    Jul 2012 Join Date
    USLocation
    26Posts

    Re: Custom PHP Tags

    What does this do? :L

  13. #13
    Apprentice masacre10 is offline
    MemberRank
    Sep 2011 Join Date
    20Posts

    Re: Custom PHP Tags

    Isn't this something like the {php}{/php} Smarty Template engine?

  14. #14
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: Custom PHP Tags

    Quote Originally Posted by azaidi View Post
    This has nothing to do with user input cause YOU are making the php script and the user input is already filtered by your own script.
    I never said this was hackable, I said eval was dangerous.

  15. #15
    retired Andrew is offline
    MemberRank
    Jun 2008 Join Date
    985Posts

    Re: Custom PHP Tags

    What's the point?

    I find it easier to type <?php than {php}
    ...



Page 1 of 2 12 LastLast

Advertisement