Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7523857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:55:25+00:00 2026-05-30T02:55:25+00:00

I have the following code. I am trying to prevent my page from resubmitting

  • 0

I have the following code. I am trying to prevent my page from resubmitting a form after a page refresh with the header(“location:location.php”); However I get a error Listed below

Error

Warning: Cannot modify header information - headers already sent by (output started at /Users/anderskitson/Sites/fiftyfity/wp-content/themes/fiftyfityNew/contact-form copy.php:7) in /Users/anderskitson/Sites/fiftyfity/wp-content/themes/fiftyfityNew/contact-form copy.php on line 68

Code

<?php
/*
Template Name: form-test.php
*/
?>

<?php include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); ?>
<?  include_once(ABSPATH. 'wp-content/themes/fiftyfityNew/contact-form.php'); ?>


<?php
/**
 * The template for displaying all pages.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the wordpress construct of pages
 * and that other 'pages' on your wordpress site will use a
 * different template.
 *
 * @package WordPress
 * @subpackage Starkers
 * @since Starkers 3.0
 */

get_header(); ?>

<script>
var i=0;
function test(){

for(i=0;i<=5;i++){
    document.write( "the number is" + i);
}
}
</script>
<script>
test();
</script>

<?php function make_user_feedback_form() {
    global $wpdb;
    global $current_user;


        $ufUserID = $current_user->ID;

        if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'updateFeedback' ) {
            $ufDataUpdate = $wpdb->insert( 'wp_user_feedback', array( 'date' => current_time('mysql'), 'responses' => $_POST["test"]) );
        }
        }?>
    <div id="form">
    <ol>
        <form method="post">
            <li><label for="test">Pick a date Babe:</label><input type="text" id="datepicker" name="test" value="" /></li> <!-- the (name="test") value is what the ('responses' => $_POST["test"]) value is talking too -->

            <li><input name="submit" type="submit" id="submit" class="submit button" value="Send feedback" /></li>
            <?php wp_nonce_field( 'updateFeedback' ); ?>
            <input name="action" type="hidden" id="action" value="updateFeedback" />
        </form>
    </ol>
    </div>
    <?php 


add_action('the_content','make_user_feedback_form');


header("location: http://localhost:8888/fiftyfity/?page_id=90");


?>


<?php 
make_user_feedback_form();
?>




<?php get_sidebar(); ?>
<?php get_footer(); ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:55:26+00:00Added an answer on May 30, 2026 at 2:55 am

    The problem is that one of the scripts you are including sends headers before WordPress gets a chance to do so, or that the blank lines between your include_once and the get_header statement makes the web server itself send its default headers.

    So, modify the first few lines to look like (i.e. removing the extra PHP opening/closing tags):

    <?php
    /*
    Template Name: form-test.php
    */
    
    include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
    include_once(ABSPATH. 'wp-content/themes/fiftyfityNew/contact-form.php');
    
    /**
     * The template for displaying all pages.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the wordpress construct of pages
     * and that other 'pages' on your wordpress site will use a
     * different template.
     *
     * @package WordPress
     * @subpackage Starkers
     * @since Starkers 3.0
     */
    
    get_header(); ?>
    

    Also check the included files for any data output, header() calls or similar adjacent opening/closing tags.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code that i am trying to change from a regular
I have the following code for adding to/extracting from Zip. I'm trying to refactor
I have the following code which pulls json data from an ASP.NET page and
I'm trying to use opengl in C#. I have following code which fails with
I have the following code that I am trying to extract the systems proxy
I have the following code sample that im trying to wrap my head around
I have the following code, I'm trying to get a table with 4 columns
I have the following code: Tag.find_all_by_company_id(4).each.collect{|tag| tag.name }.join(,) (Essentially I'm trying to build a
I am trying to mock java.awt.Toolkit.beep() using JMockit Expectations. I have the following code
I am trying my hands on WPF MVVM. I have written following code in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.