You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
351 B
20 lines
351 B
<?php
|
|
include 'model.php';
|
|
|
|
if($_POST){
|
|
$text = $_POST['new_message'];
|
|
$user1_id = $_POST['user_id'];
|
|
$user2_id = $_POST['user_2'];
|
|
$time = date('Y-m-d H:i:s');
|
|
}
|
|
|
|
$new_obj= new stdClass();
|
|
$new_obj->time= $time;
|
|
$new_obj->message= $text;
|
|
|
|
$obj= new Model();
|
|
$obj->insertChat($user1_id, $user2_id, $text, $time);
|
|
|
|
echo json_encode($new_obj);
|
|
|
|
?>
|