-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComposeMsg.php
More file actions
48 lines (42 loc) · 1.18 KB
/
ComposeMsg.php
File metadata and controls
48 lines (42 loc) · 1.18 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
<?php
// Inialize session
session_start();
$con=mysqli_connect("localhost","root","r00t","my_db");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql= mysqli_query($con,"SELECT * FROM users");
?>
<!DOCTYPE html>
<html>
<head>
<title>Compose Message</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="bootstrap/css/bootstrap.css" rel="stylesheet" media="screen">
</head>
</html>
<div class="container">
<form class="well span8" action="sendmsg.php" method="post">
<div class="row">
<div class="span3">
<ul class="nav nav-list">
<li class="nav-header">Users</li>
<?php while($row = mysqli_fetch_array($sql))
{
if ($row['Username'] != $_SESSION['username'])
echo "<li><input type=checkbox name=allusers[] value= $row[Username]>$row[Name]</li>";
}
?>
</div>
<div class="span5">
<label>Message</label>
<textarea name="msg" id="message" class="input-xlarge span5" rows="10"></textarea>
</div>
<button type="submit" class="btn btn-primary pull-right">Send</button>
</div>
</form>
</div>
</body>
</html>