-
Notifications
You must be signed in to change notification settings - Fork 0
/
testeindex.php
114 lines (93 loc) · 2.42 KB
/
testeindex.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<style>
body {
overflow: hidden;
}
.chatopen {
position: relative;
background-color: white;
width: 20%;
height: 746px;
left: 80%;
top: 0;
box-shadow: 1px 1px 4px 0px;
overflow: scroll;
visibility: visible;
z-index: 980;
}
.headerchat {
position: relative;
background-color: rgb(224, 223, 223);
width: 100%;
height: 50px;
display: flex;
column-gap: 50px;
color: #1572a1;
border-style: solid;
border-width: 1px;
border-color: #1572a1;
}
.titulochat {
position: relative;
top: -23px;
font-weight: 300;
text-decoration: underline;
FONT-SIZE: 29px;
left: 60px;
}
.digitar {
width: 470px;
position: relative;
top: 600px;
}
.enviar {
width: 22%;
height: 37px;
}
.msg {
width: 38%;
height: 35px;
}
.chat {
position: absolute;
z-index: 999999;
background-color: red;
width: 100%;
height: 400px;
color: #fff;
visibility: hidden;
}
</style>
<div class="chatopen">
<div class="headerchat">
<section class="chataberto" id="chataberto" type="none">
<div class="btnfechar">
<i class="bx-home">
<i class='bx bx-chevron-right' style='color:#1572a1'></i>
<h1 class="titulochat">CHAT</h1>
</i>
<div class="chat">
</div>
<form method="post" action="index.php" class="digitar">
<input class="msg" type="text" name="texto" placeholder="mensagem">
<input class="enviar" type="submit" value="Enviar">
</form>
</div>
</section>
</div>
<?php
require('conect.php');
$sessione = "Fonecedor";
$texto = isset($_POST['texto']) ? $_POST['texto'] : null;
$texto = null;
if (isset($_POST['texto']))
$texto = $_POST['texto'];
if ($texto != NULL) {
$query = mysqli_query($conn, "INSERT INTO chat values(default,'3','$texto')");
}
if ($sessione != NULL) {
$sql = mysqli_query($conn, "SELECT * FROM chat");
}
while ($row = mysqli_fetch_array($sql)) {
echo "Fornecedor $row[1]: $row[2]<br>";
}
?>