-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcomment.php
More file actions
25 lines (24 loc) · 742 Bytes
/
comment.php
File metadata and controls
25 lines (24 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!--Copyrights author: Frankline Bwire-->
<!--insurance management system-->
<!--theme copyrights Colorlib-->
<?php
require 'connect.php';
//variable declaration
$comment='';
$comname='';
$comemail='';
$errors=array();
//post comments to db when submit
if(isset($_POST['submitcom'])){
$comment=mysqli_real_escape_string($conn,$_POST['comment']);
$comname=mysqli_real_escape_string($conn,$_POST['comname']);
$comemail=mysqli_real_escape_string($conn,$_POST['comemail']);
//insert data to database
$sql="insert into comments (email,name,comment) values('$comemail','$comname','$comment')";
$query=mysqli_query($conn,$sql);
if(!$query){
die ('__could not submit data__'. mysqli_error($conn));
}
echo 'successfull';
}
?>