Title: PHP code causes a &#8220;Fatal error&#8221;
Last modified: October 27, 2017

---

# PHP code causes a “Fatal error”

 *  Resolved [groundagency](https://wordpress.org/support/users/groundagency/)
 * (@groundagency)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/php-code-causes-a-fatal-error/)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-code-causes-a-fatal-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [arthur-gareginyan](https://wordpress.org/support/users/arthur-gareginyan/)
 * (@arthur-gareginyan)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/php-code-causes-a-fatal-error/#post-9627627)
 * [@groundagency](https://wordpress.org/support/users/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.

 * ![](https://s.w.org/plugins/geopattern-icon/my-custom-functions_0e1030.svg)
 * [My Custom Functions](https://wordpress.org/plugins/my-custom-functions/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/my-custom-functions/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/my-custom-functions/)
 * [Active Topics](https://wordpress.org/support/plugin/my-custom-functions/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/my-custom-functions/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/my-custom-functions/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [arthur-gareginyan](https://wordpress.org/support/users/arthur-gareginyan/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/php-code-causes-a-fatal-error/#post-9627627)
 * Status: resolved