Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?
if (isset($_POST['submit'])) {
$pages = txt($_POST['pages']);
$urlico = txt($_POST['urlico']);
$name = txt($_POST['name']);
$obl = txt($_POST['obl']);
$desc = txt($_POST['desc']);
$tel = txt($_POST['tel']);
if (!is_numeric($tel)) {
$error_404 = $error_404 . "Только цифры в номере телефона!<br/>";
}
if (!$error_404) {
try {
$params = array('urlico' => $urlico, 'name' => $name, 'obl' => $obl, 'desc' => $desc, 'tel' => $tel);
$q = DB::$the->prepare("INSERT INTO `" . input($pages) . "` (urlico, name, obl, desc, tel) VALUES (:urlico, :name, :obl, :desc, :tel)");
$q->execute($params);
$error_404 = 'Данные страницы ' . name_pages_en_ru($pages) . ' обновлены!<br/>';
} catch(PDOException $e) {
$error_404 = 'Ошибка записи в БД!<br/>Обратитесь к системному администратору.<br/>'. $e->getMessage();
}
}
}