<? include ("connection.php"); include ("classes/users.class.php"); if ($_POST['user']) { $con =new connection(); $name=cleantxt($_POST['user']); $user=new users(); if (!$user->isuser($_POST['device'])) { $user->createuser($name, $_POST['device']); } header ("Location: chat.php?device={$_POST['device']}"); } ?> <html> <head> <meta name = "viewport" content = "width=device-width, minimum-scale=1, maximum-scale=1 "> </head> <body style = ""> <h2><font color="#333333">Create New User</font></h2> <meta name = "viewport" content = "width=device-width"> <form method = "post">
function writechat($idchat,$iduser, $text) { $con = new connection(); $text= cleantxt($text); $con->execute("insert into text (idchat, iduser, text, time, ip) values ('$idchat', '$iduser', '$text', '".time()."', '".$_SERVER['REMOTE_ADDR']."')"); }