Вход Регистрация
Файл: hostbiter.ru/Modules/admin/addserver.php
Строк: 43
<?
require ($_SERVER['DOCUMENT_ROOT'].'/Core/core.php');
$title 'Добавить сервер';
require (
$_SERVER['DOCUMENT_ROOT'].'/Core/myhead.php');
if(!
$user){
    
header("Location: /");
    exit;
}
if(
$user['admin'] == 0){
    
header("Location: /");
    exit;
}
if(isset(
$_GET['add'])){
    
$model htmlspecialchars(trim($_POST['model']));
    
$cpu htmlspecialchars(trim($_POST['cpu']));
    
$frequency htmlspecialchars(trim($_POST['frequency']));
    
$ram htmlspecialchars(trim($_POST['ram']));
    
$ramtype htmlspecialchars(trim($_POST['ramtype']));
    
$disctype htmlspecialchars(trim($_POST['disctype']));
    
$canal htmlspecialchars(trim($_POST['canal']));
    
$country htmlspecialchars(trim($_POST['country']));
    
$uptimeurl htmlspecialchars(trim($_POST['uptimeurl']));
    
$uptimeimg htmlspecialchars(trim($_POST['uptimeimg']));
    
$sql1 $db->prepare("INSERT INTO `servers` (`model`,`cpu`,`frequency`,`ram`,`ramtype`,`disctype`,`canal`,`country`,`uptimeurl`,`uptimeimg`) VALUES (?,?,?,?,?,?,?,?,?,?)");
    
$sql1->execute([$model,$cpu,$frequency,$ram,$ramtype,$disctype,$canal,$country,$uptimeurl,$uptimeimg]);
    
$_SESSION['message'] = 'Сервер успешно добавлен!';
    
header("Location: /servers.php");
    exit;
}
?>
<div id="border">
<form action="?add" method="post">
Модель:<br/>
<input type="text" name="model" required><br/>
CPU:<br/>
<input type="text" name="cpu" required><br/>
Частота процессора:<br/>
<input type="text" name="frequency" required><br/>
ОЗУ:<br/>
<input type="text" name="ram" required><br/>
Тип ОЗУ:<br/>
<input type="text" name="ramtype" required><br/>
Тип диска:<br/>
<input type="text" name="disctype" required><br/>
Канал связи:<br/>
<input type="text" name="canal" required><br/>
Локация:<br/>
<input type="text" name="country" required><br/>
Ссылка UpTime:<br/>
<input type="text" name="uptimeurl" required><br/>
Картинка UpTime(ссылка):<br/>
<input type="text" name="uptimeimg" required><br/>
<input type="submit" name="add" value="Добавить">
</form>
</div>
<?
require ($_SERVER['DOCUMENT_ROOT'].'/Core/myfoot.php');
?>
Онлайн: 2
Реклама