<?
$cookieColor = isset($_COOKIE['theme']) ? intval($_COOKIE['theme']) : 0; // ожидает передачи в куку theme - числа
$colorTheme = $cookieColor < 1 ? '#000' : '#fff';
?>
<meta name="theme-color" content="<?=$colorTheme?>" />
if (isset($_POST['savenewcfg'])) {
// del token & butt [name]
foreach ($_REQUEST as $rowArr) {
unset($_REQUEST['token']);
unset($_REQUEST['savenewcfg']);
}
//print_r($_REQUEST);
//$newArrF = array();
$replacements = array(); // Создаем пустой массив для замен
$fileContents = $configContent; // сохраняем оригинальный контент
foreach ($_REQUEST as $key => $value) {
// Формируем строку замены и добавляем ее в массив замен
$replacement = "public \$$key = '$value';";
$replacements[] = $replacement;
echo 'key ='.$key.' value='.$value; echo "<br>";
$fileContents = preg_replace('/public \$('.$key.') = \'([^\']+)\'\;/', $replacement, $fileContents); // Теперь применяем замены
echo json_encode($fileContents, true);
}
// Записываем измененный контент обратно в файл
file_put_contents($configFile, $fileContents);
}
$model = "Боже заработай пж";
$manuf = $_POST['manuf'];
$formFactor = $_POST['formFactor'];
$socket = $_POST['socket'];
$powerPhases = $_POST['powerPhases'];
$ramSlots = $_POST['ramSlots'];
$ramFreq = $_POST['ramFreq'];
$ramMax = $_POST['ramMax'];
$network = $_POST['network'];
$sound = $_POST['sound'];
$sataCount = $_POST['sataCount'];
$m2Count = $_POST['m2Count'];
$fan = $_POST['fan'];
$usb = $_POST['usb'];
$videoOut = $_POST['videoOut'];
$passiveCooling = $_POST['passiveCooling'];
$price = $_POST['price'];
$connect = new mysqli($server, $username, $password, $dbname)
$query = connect->query("INSERT INTO Motherboards (Model, Manufacturer, FormFactor, Socket, Power_phases, RAM_slots, RAM_freq, RAM_max, Network, Sound, SATA, M.2, FAN, USB, Video_out, Passive_cooling, Price) VALUES ('$model','$manuf','$formFactor','$socket','$powerPhases','$ramSlots','$ramFreq','$ramMax','$network','$sound','$sataCount','$m2Count','$fan','$usb','$videoOut','$passiveCooling','$price')");
functionSet($req){
/*здесь можно было бы поразбирать входные данные*/
return [
'data' => $req,
/*'data' => '', // произвольное поле */
];
}
if(isset($_POST) OR isset($_GET)){
$req = $_POST ? $_POST : $_GET;
$result = functionSet($req);
print_r($result['data']);
}
<a href="/news/2017/11/22/cskago/">Подробнее</a>
<?
$ar = [];
$br = [];
$cr = [];
$query = $mysqli->query("SELECT * FROM rich_ninja WHERE nick = '".$usdat['nick']."' AND ninja_type='n1'");
$rows1=$query->num_rows;
$rowset = $rows1 + 1;
while($nj1 = $query->fetch_array()){
$ar[$nj1['n1']] = $nj1['percent'];
$br[$nj1['n1']] = $nj1['price'];
$cr[$nj1['n1']] = $nj1['sbor'];
$calc = SumCalc($ar[$nj1['n1']],$br[$nj1['n1']],$cr[$nj1['n1']]);
# Обновляем
$sql=$mysqli->query("UPDATE rich_users SET n1 = n1 + '$calc' WHERE email = '$em_ses'");
$sql=$mysqli->query("UPDATE rich_ninja SET sbor = '$dadd' WHERE nick = '".$usdat['nick']."' AND ninja_type='n1'");
}
?>