1

I have a problem with my header location. On the first time, the header location works fine,

but, the second time, it doesn't work. I've removed all the spaces and empty rules in the code but I have still the same problem.

First header:

    <div class="col-lg-4"> 
    <?php if ($berichtauteur == $_SESSION['sess_user']) {
      ?>
      <form action="" method="post">
        <button class="btn btn-success" type="submit" name="beantwoord">Markeren als beantwoord </button>
      </form>
      <?php
      if (isset($_POST['beantwoord'])) {
        $updatestatus = "UPDATE forum_subonderwerp SET subonderwerp_status = '1' where subonderwerp_ID=". $subject. ";";
        @mysqli_query ($verbinding, $updatestatus) or die (mysqli_error($verbinding));
        header('Location: http://google.nl');
      }
    }
    ?>
  </div>

Second header:

            <div class="modal-body">
        <form action="" method="post">
          <textarea name="text" id="text"></textarea>
          <script>CKEDITOR.replace('text');</script>
          <button class="btn btn-warning" type="submit" name="plaatsreactie">Plaats reactie </button>
        </form>
    </div>
    <?php
    if (isset($_POST["plaatsreactie"])) {
      header('Location: http://qooqle.nl');
      $queryinput ="INSERT INTO forum_reacties (reactie_bericht, subonderwerp_ID, reactie_plaatser) VALUES ('".$_POST['text']."', '".$subject."', '".$useridnummer."')";
      @mysqli_query ($verbinding, $queryinput) or die (mysqli_error($verbinding));
    }
    ?>
  </div>

2 Answers2

0

You wrote http://qooqle.nl instead of google.nl in your seond header. I don't know if you have put that in purpose..

0

Place the following things at the top so that you can find the reasons for not being working proper.

1.) Try One:

error_reporting(E_ALL);

error_reporting — Sets which PHP errors are reported

The error_reporting() function sets the error_reporting directive at runtime. PHP has many levels of errors, using this function sets that level for the duration (runtime) of your script. If the optional level is not set, error_reporting() will just return the current error reporting level.

2.) Try Two:

Try placing the ob_start() at the top before redirection occurs.

ob_start — Turn on output buffering

And in the second header you have to replace the redirection location

Replace:

 header('Location: http://qooqle.nl');

with

 header('Location: google.nl');
Naresh Kumar P
  • 4,127
  • 2
  • 16
  • 33