Skip to content

Instantly share code, notes, and snippets.

@webyroki
webyroki / Create_table.sql
Created February 21, 2016 16:52 — forked from ashutoshlr/Create_table.sql
PHP - Chat Application
CREATE TABLE `s_chat_messages` (
`id` INT(11) NOT NULL AUTO_INCREMENT ,
`user` VARCHAR(255) NOT NULL ,
`message` VARCHAR(255) NOT NULL ,
`when` INT(11) NOT NULL ,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@webyroki
webyroki / gist:451958439d460ec3d8e5
Created February 21, 2016 16:50 — forked from sotarok/gist:33390
php simple chat
<?php
define("URL", "http://あなたの設置したPHPファイルのURL");
define("TIME", time());
define("__THIS_FILE__", file_get_contents(__FILE__));
define("__THIS_SCRIPT__", substr(__THIS_FILE__, 0, strpos(__THIS_FILE__, "__" . "halt_compiler();") + 19));
$logs = explode("\n", substr(__THIS_FILE__, strpos(__THIS_FILE__, "__" . "halt_compiler();") + 19));
if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') == 0) {
if (isset($_POST['text']) && !empty($_POST['text'])
&& isset($_POST['name']) && !empty($_POST['name'])) {
@webyroki
webyroki / chat.php
Last active February 21, 2016 16:46 — forked from iGusev/chat.php
php-chat
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<meta http-equiv="refresh" content="2">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
.chat-body {
margin-bottom: 10px;