-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchatC1.php
37 lines (24 loc) · 816 Bytes
/
chatC1.php
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
26
27
28
29
30
31
32
33
34
35
36
37
<?php
$conn = mysqli_connect("localhost","root","","fix","3310");
$_SESSION["customer"] = "kesavi";
$_SESSION["tradesman"] = "mathi";
if(isset($_GET['msg'])){
$msg= $_GET["msg"];
$customer = $_SESSION["customer"];
$tradesman= $_SESSION["tradesman"];
$hiring_id =1;
$sql = "insert into chat (message,sender,receiver,hiring_id) VALUES ('$msg','$tradesman','$customer','$hiring_id');";
mysqli_query($conn, $sql);
$id = mysqli_insert_id($conn);
?>
<div class="row d-flex justify-content-between my-3 fw-bold">
<div class="col-4"></div>
<div class="col-8">
<div class="mx-2" id="send_msg"><span><?php echo $msg; ?></span></div>
</div>
</div>
<?php
}else{
echo "NO POSTGET['submit'] created yet!!";
}
?>