Advertisement
Guest User

Untitled

a guest
May 12th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.87 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  
  5. */
  6.  
  7.  
  8. require_once('classes/MySQLGopher.php');
  9. require_once('classes/LKChat.php');
  10.  
  11. $LKChat = new LKChat();
  12.  
  13.     $LKChat->hostname = "joshpc1:3306";
  14.     $LKChat->user = "root";
  15.     $LKChat->password = "root";
  16.    
  17.     $LKChat->db = "lkchat";
  18.     $LKChat->table = $LKChat->table;
  19.    
  20.     $LKChat->errorSwitch = 0;
  21.    
  22. $LKChat->connect();
  23. $LKChat->selectDB();
  24.  
  25. $LKChat->initializeDataBaseStructure();
  26.  
  27. if (isset($_GET['operation'])) {
  28.     $go = $_GET['operation'];
  29.     switch ($go) {
  30.         case "init":
  31.             $LKChat->initChatWindow();
  32.             break;
  33.         case "write":
  34.             $message = $_GET['message'];
  35.             $user = $_GET['user'];
  36.             //$lastTimeStamp = $_GET['lastTimeStamp'];
  37.             $LKChat->writeMsg($user, $message);
  38.             //$LKChat->update($lastTimeStamp);
  39.             break;
  40.         case "update":
  41.             $lastTimeStamp = $_GET['lastTimeStamp'];
  42.             $LKChat->update($lastTimeStamp);
  43.             break;
  44.     }
  45.     die();
  46. }
  47.  
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement