ito po ang error
Warning: Undefined array key "comment_content" in C:\xampp\htdocs\Innerjoin\user\comment.php on line 93
<div class="container col-md-6 bg-body-tertiary border mt-3 rounded-3" >
<form method="POST">
<input type="hidden" name="id" value="<?php echo $username; ?>">
<label class="fw-bold mb-2" for="w3review">Comment:</label>
<textarea name="comment_content" class="form-control" id="post" rows="4" cols="40" placeholder="Your Content....."></textarea>
<div class="form-group mb-2 mt-2" style="text-align: right">
<input type="submit" name="comment" value="Reply" class="w-25" value="Post" style="background-color:#0D52C7;">
</div>
</form>
</div>
<?php
if (isset($_POST['comment'])){
$comment_content = $_POST['comment_content'];
$post_id=$_POST['id'];
mysqli_query($conn,"insert into comment (content,date_posted,user_id,post_id) values ('$comment_content','".strtotime(date("Y-m-d h:i:sa"))."','$user_id','$post_id')") or die (mysqli_error());
header('locationost.php');
}
?>
Warning: Undefined array key "comment_content" in C:\xampp\htdocs\Innerjoin\user\comment.php on line 93
<div class="container col-md-6 bg-body-tertiary border mt-3 rounded-3" >
<form method="POST">
<input type="hidden" name="id" value="<?php echo $username; ?>">
<label class="fw-bold mb-2" for="w3review">Comment:</label>
<textarea name="comment_content" class="form-control" id="post" rows="4" cols="40" placeholder="Your Content....."></textarea>
<div class="form-group mb-2 mt-2" style="text-align: right">
<input type="submit" name="comment" value="Reply" class="w-25" value="Post" style="background-color:#0D52C7;">
</div>
</form>
</div>
<?php
if (isset($_POST['comment'])){
$comment_content = $_POST['comment_content'];
$post_id=$_POST['id'];
mysqli_query($conn,"insert into comment (content,date_posted,user_id,post_id) values ('$comment_content','".strtotime(date("Y-m-d h:i:sa"))."','$user_id','$post_id')") or die (mysqli_error());
header('locationost.php');
}
?>