-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathchat_send.php
More file actions
45 lines (29 loc) · 713 Bytes
/
Copy pathchat_send.php
File metadata and controls
45 lines (29 loc) · 713 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
include_once 'config/config.php';
var_dump($_POST);
$mymsg=$_POST['mymsg'];
//$msg=$_POST['msg'];
$frm_id=$_SESSION['employee_id'];
$to_id=$_GET['id'];
$ctime=date("h:i:s");
$stts="1";
$q="INSERT INTO chat(from_id,to_id,message,chattime) values('$frm_id','$to_id','$mymsg','$ctime')";
echo $q;
// if(mysqli_affected_rows($db_obj) > 0)
if(mysqli_affected_rows($connection_obj) > 0)
{
$shift_data = mysqli_fetch_assoc($q);
}
else
{
header("location:./500.php");
}
$status = mysqli_query($connection_obj,$q);
if($status)
{
header("location:./chat.php?id=".$to_id);
}
else
{
header("location:./500.php");
}