I am new to php, just trying to create a simple form but it's not working. here is my code
<?php
if (isset($_POST['user_input'])&&!empty($_POST['user_input'])){
echo "THIS WORKS!!!";
}
?>
<hr>
<form action="new.php" method="POST">
<textarea name="user_input" rows="6" cols="30"> </textarea>
<br>
<br>
<input type="submit" value="Submit">
</form>
here is the error that appears on browser
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 changed
always_populate_raw_post_data = -1
in php.ini file
Now the error message is not appearing but the code still not working on clicking submit button the text in text area is erased and no output is produced using phpstorm ide and php 5.6.32
this also not working
<?php
error_reporting(E_ALL);ini_set('display_errors',1);
?>
<form method="POST">
<textarea name="user_input" rows="6" cols="30"> </textarea>
<br>
<br>
<input type="submit" value="Submit">
</form>
<?php
if (isset($_POST['user_input'])){
echo "THIS WORKS!!!";
}
?>