Support » Plugin: My Custom Functions » PHP code causes a “Fatal error”

  • Resolved groundagency

    (@groundagency)


    Hiya

    I have just inserted some code and have gottoen the error meassage: “Sorry, but your code causes a “Fatal error”, so it is not applied!”

    This is the code:
    add_action( ‘wp_footer’, ‘pum14_popup_reg_form_check’, 1000 );
    function pum14_popup_reg_form_check() {
    if ( isset( $_POST[‘popmake-download-best-practice-guidelines’] ) && $_POST[‘popmake-download-best-practice-guidelines’] == ‘my_form’ ) {
    <script type=”text/javascript”>
    PUM.open(1594);
    </script>
    }
    }

    Please could you let me know where I am going wrong. Happy to donate via Paypal if this can get resolved : )

    Many thanks,
    Natalie

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Space X-Chimp

    (@arthur-gareginyan)

    @groundagency Hi Natalie,

    Thank you for choosing my WordPress plugin! 🙂

    Your PHP code has incorrect quotation marks, and also the HTML tags ?> <?php are missing. Please try the following:

    
    function pum14_popup_reg_form_check() {
        if ( isset( $_POST['popmake-download-best-practice-guidelines'] ) && $_POST['popmake-download-best-practice-guidelines'] == 'my_form' ) {
            ?>
                <script type="text/javascript">
                    PUM.open(1594);
                </script>
            <?php
        }
    }
    add_action( 'wp_footer', 'pum14_popup_reg_form_check', 1000 );
    

    Have a good day.

    Regards,
    Arthur

Viewing 1 replies (of 1 total)
  • The topic ‘PHP code causes a “Fatal error”’ is closed to new replies.