-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpageload.php
More file actions
26 lines (22 loc) · 755 Bytes
/
pageload.php
File metadata and controls
26 lines (22 loc) · 755 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
<?php
$user=$_REQUEST["usr"];
$othr=$_REQUEST["othr"];
$link=mysqli_connect("localhost","root","");
mysqli_select_db($link,"chatapp");
$resu=mysqli_query($link,"SELECT * FROM msg_grp WHERE me LIKE '$user' OR me LIKE '$othr' ");
if(mysqli_num_rows($resu) != 0){
while($rowes=mysqli_fetch_array($resu)){
if(($user == $rowes['me'] && $othr == $rowes['username']) || ($othr == $rowes['me'] && $user == $rowes['username'])){
$tablnm=$rowes['tablename'];
$res=mysqli_query($link,"SELECT * FROM $tablnm");
while($rows=mysqli_fetch_array($res)){
if($user==$rows['receiver']){
echo "<div class='other'>".$rows['msg']."</div>";
}
else if($user==$rows['sender']){
echo "<div class='me'>".$rows['msg']."</div>";
}}
}
}
}
?>