Esempio n. 1
0
if ($_SESSION['admin']) {
if ($_POST['submit']){

$vopr = $_POST['vopradd'];
$pass1 = $_POST['1'];
$pass1img = $_POST['img1'];
$true1 = 1;
$pass2 = $_POST['2'];
$pass2img = $_POST['img2'];
$true2 = 0;
$pass3 = $_POST['3'];
$pass3img = $_POST['img3'];
$true3 = 0;

$name = file_newname_count('data/answers/'.$vopr.'/', '');

if (!is_dir('data/answers/'.$vopr.'/')) {
	mkdir('data/answers/'.$vopr, 0700);
}

$questdata1['name'] = 1;
$questdata1['pass'] = $pass1;
$questdata1['true'] = $true1;
$questdata1['img'] = $pass1img;

$questdata2['name'] = 2;
$questdata2['pass'] = $pass2;
$questdata2['true'] = $true2;
$questdata2['img'] = $pass2img;
Esempio n. 2
0
require 'include/functions.php';
include ('header.php');

if ($_POST['submitt']) {
 if ($_POST['admin'] == 'admin'){
 $_SESSION['admin'] = true;
 }
}

if ($_SESSION['admin']) {
if ($_POST['submit']){

$vopr = $_POST['vopradd'];
$voprimg = $_POST['voprimg'];
$type = 'questions';
$name = file_newname_count('data/questions/', '');

$questdata['name'] = $vopr;
$questdata['img'] = $voprimg;

saveEntry($type, $name[1], $questdata);
echo 'Успешно добавлен '.$name[1].' вопрос';
?>

        <div class="row">
        <div class="col-md-12">
                	<center>
<div style="width:300px">
<a href="#" id="add">Добавить</a> | <a href="#" id="remove">Удалить</a>  | <a href="#" id="reset">Сбросить</a>
<form action="addques.php" method="post">
   <br>