-
Notifications
You must be signed in to change notification settings - Fork 0
/
sendmessage.php
45 lines (30 loc) · 985 Bytes
/
sendmessage.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
38
39
40
41
42
43
44
45
<?php
// session_start();
// $servername = "localhost";
// $username = "root";
// $password = "";
// $dbname="ludo";
include("config.php");
$name= $_POST['name'];
$body= $_POST['body'];
// $fel= $_POST['fel'];
// $setdun= $_POST['set'];
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed:". $conn->connect_error);
}
$sql = "INSERT INTO chat (name,body) VALUES ('$name' , '$body') ";
// $sql = "UPDATE grpchatseen SET seen=1 where toid='$fromid' AND grpid='$grpid'";
// $sql = "UPDATE messages SET seento=1 where grpid='$grpid' AND ";
$result = $conn->query($sql);
// $temp="";
// if ($result->num_rows > 0) {
// while($row = $result->fetch_assoc()) {
// $temp=$row["kardun"].$row["dun"].$row["fel"];
// }
// }
// echo $temp;
$conn->close();
echo "hi";
?>