SQLI form submission with php error
<p>I am using wampserver php version 5.6.16,
I trying to collect the data from form submission:</p>
<pre><code>//First create database
CREATE DATABASE 'college';
Then create table
CREATE TABLE 'students' (
'student_id' int(11) NOT NULL AUTO_INCREMENT,
'student_name' varchar(255) NOT NULL,
'student_email' varchar(255) NOT NULL,
'student_city' varchar(255) NOT NULL,
PRIMARY KEY ('student_id') )
</code></pre>
<p>After that I create the page code:</p>
<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;insert data in database using mysqli&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div id=&quot;main&quot;&gt;
&lt;h1&gt;Insert data into database using mysqli&lt;/h1&gt;
&lt;div id=&quot;login&quot;&gt;
    &lt;h2&gt;Student's Form&lt;/h2&gt;
    &lt;hr/&gt;
    &lt;form action=&quot;kiri.php&quot; method=&quot;POST&quot;&gt;
        &lt;label&gt;Student Name :&lt;/label&gt;
        &lt;input type=&quot;text&quot; name=&quot;stu_name&quot; id=&quot;name&quot; required=&quot;required&quot; placeholder=&quot;Please Enter Name&quot;/&gt;&lt;br /&gt;&lt;br /&gt;
        &lt;label&gt;Student Email :&lt;/label&gt;
        &lt;input type=&quot;email&quot; name=&quot;stu_email&quot; id=&quot;email&quot; required=&quot;required&quot; placeholder=&quot;john123@gmail.com&quot;/&gt;&lt;br/&gt;&lt;br /&gt;
        &lt;label&gt;Student City :&lt;/label&gt;
        &lt;input type=&quot;text&quot; name=&quot;stu_city&quot; id=&quot;city&quot; required=&quot;required&quot; placeholder=&quot;Please Enter Your City&quot;/&gt;&lt;br/&gt;&lt;br /&gt;
        &lt;input type=&quot;submit&quot; value=&quot; Submit &quot; name=&quot;submit&quot;/&gt;&lt;br /&gt;
    &lt;/form&gt;
&lt;/div&gt;


&lt;/div&gt;
&lt;?php
if(isset($_POST[&quot;submit&quot;])){
$servername = &quot;localhost&quot;;
$username = &quot;root&quot;;
$password = &quot;&quot;;
$dbname = &quot;college&quot;;

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn-&gt;connect_error) {
    die(&quot;Connection failed: &quot; . $conn-&gt;connect_error);
}

$sql = &quot;INSERT INTO students (student_name, student_email, student_city)
VALUES ('&quot;.$_POST[&quot;stu_name&quot;].&quot;','&quot;.$_POST[&quot;stu_email&quot;].&quot;','&quot;.$_POST[&quot;stu_city&quot;].&quot;')&quot;;

if ($conn-&gt;query($sql) === TRUE) {
    echo &quot;&lt;script type= 'text/javascript'&gt;alert('New record created successfully');&lt;/script&gt;&quot;;
} else {
    echo &quot;&lt;script type= 'text/javascript'&gt;alert('Error: &quot; . $sql . &quot;&lt;br&gt;&quot; . $conn-&gt;error.&quot;');&lt;/script&gt;&quot;;
}

$conn-&gt;close();
}
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p>But I get this error:</p>
<blockquote>
<p>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</p>
<p>Warning: Cannot modify header information - headers already sent in Unknown on line 0</p>
</blockquote>