????

Your IP : 18.191.198.245


Current Path : /home2/morganrand/backup.morganrand.com/design_room/
Upload File :
Current File : /home2/morganrand/backup.morganrand.com/design_room/read_state.php

<?php
if (isset($_GET['rm']))
{
    if (is_numeric($_GET['rm']))
    {
        $room = $_GET['rm'];
        $pass = isset($_GET['pw']) ? $_GET['pw'] : '';    
        $conn = null;
        // ** MySQL settings ** //
        require_once('../db_connection.php');        

        $sql = "SELECT * FROM design_room WHERE room_num=" . $room;
        $result = $conn->query($sql);

        if ($result->num_rows > 0) {
            // output data of each row
            while($row = $result->fetch_assoc()) {
                if ($pass == strtolower($row['password']) and $row['user_privileges'] == '1') {
                    echo "OK";
                } else {
                    echo $row['designer_state'];
                }
            }
        } else {
            echo "0 results";
            exit;
        }

        $conn->close();
    }    
}
?>