-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchatdb.php
More file actions
33 lines (29 loc) · 1 KB
/
chatdb.php
File metadata and controls
33 lines (29 loc) · 1 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
<?php
$room = $_GET['room'];
$username = $_GET['username'];
// echo $username;
// echo $room;
include "db_connect.php";
$query = "SELECT * FROM `claimed_rooms` WHERE room_name = '$room'";
// echo $query;
$result = mysqli_query($conn, $query);
if($result){
if(mysqli_num_rows($result)>0){
echo "<script language = 'javascript'>";
echo 'window.location="./room.php?room_name='. $room."&username=".$_GET['username'].'";';
echo "</script>";
}
else{
// $msg = "This room doesn't exist...";
// echo "<script language = 'javascript'>";
// // echo "alert('$msg');";
// echo 'window.location="./home2.php?username='.$_GET['username'].'";';
// echo "</script>";
$msg = "invalid chatroom - plz create once";
echo "<script language = 'javascript'>";
echo "alert('$msg');";
echo 'window.location="./home2.php?username='.$_GET['username'].'";';
echo "</script>";
}
}
?>