Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
function process_mass()
{
include 'massages.php';
include_once './model/model.php';
include_once 'islogin.php';
$get=new massages1();
$ids=new is_login();
$insert=new massages_conn();
$to=$get->to;;
$title=$get->title;
$message=$get->message;
$from=$ids->Get_user_from_ID();
$to=$ids->Get_user_to_ID($to);
$add=$insert->insert_msg($title, $message, $from, $to);
}
function islogin()
{
if(isset($_COOKIE['access']))
{
require_once 'function.php';
require_once './model/dbconn.php';
$nick=filter($_COOKIE['access']);
$conn= new valid_name;
$conn=$conn->ValidName($nick);
$coin=mysql_num_rows($conn);
if($coin ==1)
{
return true;
}
else
{
hack("Фалшива бисквитка", $ip);
}
}
}
function Get_user_from_ID()
{
if(islogin()===true)
{
require_once 'function.php';
require_once './model/dbconn.php';
$nick=filter($_COOKIE['access']);
$conn= new valid_name;
$conn=$conn->ValidName($nick);
$coin=mysql_fetch_assoc($conn);
return $coin['id'];
}
}
function Get_user_to_ID($nick)
{
if(islogin()===true)
{
require_once 'function.php';
require_once './model/dbconn.php';
$nick=filter($nick);
$conn= new valid_name;
$conn=$conn->ValidName($nick);
$coin=mysql_fetch_assoc($conn);
return $coin['id'];
}
}
<?php
class massages1
{
var $error = array();
var $to;
var $title;
var $message;
function Get()
{
include './function.php';
if(isset($_POST['to']))
{
if(preg_match("/^[a-zа-я0-9 ]+$/iu", $_POST['to']))
{
if(strlen($_POST['to'])>=3)
{
if(strlen($_POST['to'])<=15)
{
$this->to=filter($_POST['to']);
}
else
{
$this->error['to']="Голямо име за потребителя";
}
}
else
{
$this->error['to']="Късо име за потребителя";
}
}
else
{
$this->error['to']="Непозволени символи";
}
}
else
{
$this->error['to']="Празно запитване";
}
if(isset($_POST['title']))
{
if(preg_match("/^[a-zа-я0-9 ]+$/iu", $_POST['title']))
{
if(strlen($_POST['title'])>=3)
{
if(strlen($_POST['title'])<=50)
{
$this->titile=filter($_POST['title']);
}
else
{
$this->error['title']="Голямо1 име за потребителя";
}
}
else
{
$this->error['title']="Късо1 име за потребителя";
}
}
else
{
$this->error['title']="Непозволени1 символи";
}
}
else
{
$this->error['title']="Празно1 запитване";
}
if(isset($_POST['message']))
{
if(preg_match("/^[a-zа-я0-9 ]+$/iu", $_POST['message']))
{
if(strlen($_POST['message'])>=3)
{
if(strlen($_POST['message'])<=250)
{
$this->message=filter($_POST['message']);
}
else
{
$this->error['message']="Голямо2 име за потребителя";
}
}
else
{
$this->error['message']="Късо2 име за потребителя";
}
}
else
{
$this->error['message']="Непозволени2 символи";
}
}
else
{
$this->error['message']="Празно2 запитване";
}
}
}
?>
class massages_conn
{
function insert_msg($title,$message,$from,$to)
{
$query="INSERT INTO `messages`(`title`,`message`,`from`,`to`,`created`) VALUES('$title','$message','$from','$to')";
return $result=mysql_query($query);
}
}