0

Whenever I submit my form to execute a php script, I get the error messages:

Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and 
will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0

Warning: Cannot modify header information - headers already sent in Unknown on line 0

I have uncommented and made sure it was -1. I also switched to php 7 and restarted my Wamp server. I also checked for whitespace before en after the php element. Nevertheless I still get the error message.

What else could it possibly be?

script.php

<?php
parse_str(file_get_contents("php://input"), $_POST);
$link = mysqli_connect("127.0.0.1", "root", "", "izandb");

if(isset($_POST['submit'])) {

$klas = $_POST['klasDown'];
$naam = $_POST['naamTxt'];
$percentages = $_POST['percentages'];
$antwoorden = $_POST['antwoorden'];

$stmt = $link->prepare('
INSERT INTO resultaten (Klas, Naam, Percentages, Antwoorden)
VALUES (?, ?, ?, ?)
');
    $stmt->bind_param('ssss', $klas, $naam, $percentages, $antwoorden);
    $stmt->execute();

    echo "Insertion succeed";
}
Y_Lakdime
  • 825
  • 2
  • 15
  • 33

1 Answers1

0

I rebooted my computer and it worked

Y_Lakdime
  • 825
  • 2
  • 15
  • 33