• Resolved Max

    (@panmac)


    Hi there –
    I’m migrating an existing static site into wordpress for the first time, so please be kind.

    We use a custom form so I haven’t researched any plugins, and I’d love to get this to work as-is.

    The problem is that after the form is submitted and validates, I need the page to redirect to a page with a thank you message, and it’s throwing a fatal error instead.

    The form action is set to send the form to an external validation file. The vaildation file then redirects the browser to:

    header ('Location: involved_thanks_volunteer.php');

    and then the error message loads:

    Fatal error: Call to undefined function get_header() in /home/panmac11/phoenixrisingtheater.org/dynamic/wp-content/themes/phoenixtheme/involved_thanks_volunteer.php on line 11

    Even though the form validates and then is emailed properly.

    I’ve set up involved_thanks_volunteer.php as a page template, as was suggested in this forum elsewhere, but the same error occurs.

    Here’s the top of my code for involved_thanks_volunteer.php”

    <?php
    /* Template Name: Thank You Volunteer Form 
    
    */
    
    ?>
    
    <?php get_header(); ?>  
    
    <?php include(TEMPLATEPATH . '/inc/nav.php'); ?>

    and then the content.

    Any help would be appreciated. You can see the form here:
    https://www.phoenixrisingtheater.org/dynamic/get-involved/

Viewing 1 replies (of 1 total)
  • Thread Starter Max

    (@panmac)

    I managed to fix it!

    I needed the redirect in the validation script to point towards the wordpress slug. DUH.

Viewing 1 replies (of 1 total)
  • The topic ‘undefined function get_header() after submit form’ is closed to new replies.