Support

Account

Home Forums Front-end Issues Execute PHP SCRIPT Reply To: Execute PHP SCRIPT

  • Hi @felix1337

    Before you proceed with this, please realize the security hole this will cause in your website. If a spam attack was to ever inject code into your DB, your website could actually run it!

    This aside, you can use a text field to save any code. Then on the front end, you can run it like so:

    
    $code = get_field('code');
    eval( $code );
    

    Ref: http://www.php.net/eval

    Thanks
    E