-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmessage.php
More file actions
60 lines (54 loc) · 1.52 KB
/
message.php
File metadata and controls
60 lines (54 loc) · 1.52 KB
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
<?php session_start(); include("include/header.php"); ?>
<div class="top_bg">
<div class="wrap">
<div class="top">
<h2>Type Message<a href="logout.php">Logout</a></h2>
</div>
</div>
</div>
</div>
<!-- start main -->
<div class="wrap">
<div class="main">
<div class="msg">
<?php
include("include/config.php");
$id=$_SESSION['client']['uid'];
$message=$_GET['id'];
$em="select * from message where m_from=$id and m_to=$message";
$em_res=mysql_query($em,$link);
if($em_res>0)
{
while($em_row=mysql_fetch_array($em_res))
{
$e="select * from register where r_id=$message";
$e_res=mysql_query($e,$link);
$e_row=mysql_fetch_array($e_res);
echo '<br/>'.$e_row['r_fnm'].' '.$e_row['r_unm'].'<br/>';
echo $em_row['message'];
}
}
$emv="select * from message where m_to=$id and m_from=$message";
$emv_res=mysql_query($emv,$link);
if($emv_res>0)
{
while($emv_row=mysql_fetch_array($emv_res))
{
$ev="select * from register where r_id=$id";
$ev_res=mysql_query($ev,$link);
$ev_row=mysql_fetch_array($ev_res);
echo '<br/><br/>'.$ev_row['r_fnm'].' '.$ev_row['r_unm'].'<br/>';
echo $emv_row['message'];
}
}
?>
<div class="send">
<form action="msg_fnd.php?id=<?php echo $message; ?>" method="post">
<textarea cols="100" rows="10" name="msgs" placeholder="Type a message"></textarea>
<input type="submit" name="send" value="send" class="btn">
</form>
</div>
</div>
</div>
</div>
<?php include("include/footer.php"); ?>