当前位置: 首页>>代码示例>>PHP>>正文


PHP functions::check方法代码示例

本文整理汇总了PHP中functions::check方法的典型用法代码示例。如果您正苦于以下问题:PHP functions::check方法的具体用法?PHP functions::check怎么用?PHP functions::check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在functions的用法示例。


在下文中一共展示了functions::check方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: auth

 static function auth($login, $password)
 {
     $login = functions::check($login);
     $password = functions::check($password);
     $error = "";
     if (!empty($login) && !empty($password)) {
         $user = users::getUser(1, $login, $password);
         if ($user->id > 0) {
             $_SESSION["s_user"] = $user->toArray();
         } else {
             $error = "Вы ввели не верные логин или пароль";
         }
     } else {
         $error = "Необходимо заполнить все поля";
     }
     return $error;
 }
开发者ID:bogiesoft,项目名称:yii-travel,代码行数:17,代码来源:functions.php

示例2: defined

*/
defined('_IN_JOHNCMS') or die('Error: restricted access');
require_once '../incfiles/head.php';
echo '<div class="phdr"><a href="index.php"><b>' . $lng['downloads'] . '</b></a> | ' . $lng['search'] . '</div>';
if (!empty($_GET['srh'])) {
    $srh = functions::check($_GET['srh']);
} else {
    if ($_POST['srh'] == "") {
        echo functions::display_error($lng_dl['search_string_empty'], '<a href="index.php">' . $lng['back'] . '</a>');
        require_once '../incfiles/end.php';
        exit;
    }
    $srh = functions::check($_POST['srh']);
}
if (!empty($_GET['srh'])) {
    $srh = functions::check($_GET['srh']);
}
$psk = mysql_query("select * from `download` where  type='file' ;");
if (empty($_GET['start'])) {
    $start = 0;
} else {
    $start = $_GET['start'];
}
while ($array = mysql_fetch_array($psk)) {
    if (stristr($array['name'], $srh)) {
        $res[] = $lng_dl['found_by_name'] . ":<br/><a href='?act=view&amp;file=" . $array['id'] . "'>{$array['name']}</a><br/>";
    }
    if (stristr($array['text'], $srh)) {
        $res[] = $lng_dl['found_by_description'] . ":<br/><a href='?act=view&amp;file=" . $array['id'] . "'>{$array['name']}</a><br/>{$array['text']}<br/>";
    }
}
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:search.php

示例3: defined

defined('_IN_JOHNCMS') or die('Error: restricted access');
require_once "../incfiles/head.php";
if ($rights == 4 || $rights >= 6) {
    if (empty($_GET['cat'])) {
        $loaddir = $loadroot;
    } else {
        $cat = intval($_GET['cat']);
        provcat($cat);
        $cat1 = mysql_query("select * from `download` where type = 'cat' and id = '" . $cat . "';");
        $adrdir = mysql_fetch_array($cat1);
        $loaddir = "{$adrdir['adres']}/{$adrdir['name']}";
    }
    if (isset($_POST['submit'])) {
        $url = trim($_POST['url']);
        $opis = functions::check($_POST['opis']);
        $newn = functions::check($_POST['newn']);
        $tipf = functions::format($url);
        if (eregi("[^a-z0-9.()+_-]", $newn)) {
            echo "В новом названии файла <b>{$newn}</b> присутствуют недопустимые символы<br/>Разрешены только латинские символы, цифры и некоторые знаки ( .()+_- )<br /><a href='?act=import&amp;cat=" . $cat . "'>Повторить</a><br/>";
            require_once '../incfiles/end.php';
            exit;
        }
        $import = "{$loaddir}/{$newn}.{$tipf}";
        $files = file("{$import}");
        if (!$files) {
            if (copy($url, $import)) {
                $ch = "{$newn}.{$tipf}";
                echo "Файл успешно загружен<br/>";
                mysql_query("insert into `download` values(0,'{$cat}','" . mysql_real_escape_string($loaddir) . "','" . time() . "','" . mysql_real_escape_string($ch) . "','file','','','','" . $opis . "','');");
            } else {
                echo "Загрузка файла не удалась!<br/>";
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:import.php

示例4: switch

if (!empty($_SESSION['uid'])) {
    if (!empty($_GET['act'])) {
        $act = $_GET['act'];
    }
    switch ($act) {
        case "add":
            echo '<div class="phdr">' . $lng_pm['add_to_ignor'] . '</div>';
            echo "<form action='ignor.php?act=edit&amp;add=1' method='post'>" . $lng_pm['enter_nick'] . "<br/>";
            echo "<input type='text' name='nik' value='' /><br/><input type='submit' value='" . $lng['add'] . "' /></form>";
            echo '<a href="ignor.php">' . $lng['back'] . '</a><br/>';
            break;
        case "edit":
            if (!empty($_POST['nik'])) {
                $nik = functions::check($_POST['nik']);
            } elseif (!empty($_GET['nik'])) {
                $nik = functions::check($_GET['nik']);
            } else {
                if (empty($_GET['id'])) {
                    echo "ERROR!<br/><a href='ignor.php'>Back</a><br/>";
                    require_once '../incfiles/end.php';
                    exit;
                }
                $nk = mysql_query("select * from `users` where id='" . $id . "';");
                $nk1 = mysql_fetch_array($nk);
                $nik = $nk1['name'];
            }
            if (!empty($_GET['add'])) {
                $add = intval($_GET['add']);
            }
            $adc = mysql_query("select * from `privat` where me='" . $login . "' and ignor='" . $nik . "';");
            $adc1 = mysql_num_rows($adc);
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:ignor.php

示例5: mysql_query

// Проверка на флуд
$flood = functions::antiflood();
if ($flood) {
    require '../incfiles/head.php';
    echo functions::display_error($lng['error_flood'] . ' ' . $flood . $lng['sec'] . ', <a href="index.php?id=' . $id . '&amp;start=' . $start . '">' . $lng['back'] . '</a>');
    require '../incfiles/end.php';
    exit;
}
$req_r = mysql_query("SELECT * FROM `forum` WHERE `id` = '{$id}' AND `type` = 'r' LIMIT 1");
if (!mysql_num_rows($req_r)) {
    require '../incfiles/head.php';
    echo functions::display_error($lng['error_wrong_data']);
    require '../incfiles/end.php';
    exit;
}
$th = isset($_POST['th']) ? functions::check(mb_substr(trim($_POST['th']), 0, 100)) : '';
$msg = isset($_POST['msg']) ? functions::checkin(trim($_POST['msg'])) : '';
$buzz_prefix = $_POST['tiento'];
if (isset($_POST['msgtrans'])) {
    $th = functions::trans($th);
    $msg = functions::trans($msg);
}
$msg = preg_replace_callback('~\\[url=(http://.+?)\\](.+?)\\[/url\\]|(http://(www.)?[0-9a-zA-Z\\.-]+\\.[0-9a-zA-Z]{2,6}[0-9a-zA-Z/\\?\\.\\~&amp;_=/%-:#]*)~', 'forum_link', $msg);
if (isset($_POST['submit']) && isset($_POST['token']) && isset($_SESSION['token']) && $_POST['token'] == $_SESSION['token']) {
    $error = array();
    if (empty($th)) {
        $error[] = $lng_forum['error_topic_name'];
    }
    if (mb_strlen($th) < 2) {
        $error[] = $lng_forum['error_topic_name_lenght'];
    }
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:nt.php

示例6: intval

if ($rights == 4 || $rights >= 6) {
    if (!empty($_GET['cat'])) {
        $cat = intval($_GET['cat']);
    }
    if (isset($_POST['submit'])) {
        if (empty($cat)) {
            $droot = $loadroot;
        } else {
            $cat = intval(trim($cat));
            provcat($cat);
            $cat1 = mysql_query("select * from `download` where type = 'cat' and id = '" . $cat . "';");
            $adrdir = mysql_fetch_array($cat1);
            $droot = "{$adrdir['adres']}/{$adrdir['name']}";
        }
        $drn = functions::check($_POST['drn']);
        $rusn = functions::check($_POST['rusn']);
        $mk = mkdir("{$droot}/{$drn}", 0777);
        if ($mk == true) {
            chmod("{$droot}/{$drn}", 0777);
            echo "Папка создана<br/>";
            mysql_query("insert into `download` values(0,'" . $cat . "','" . $droot . "','" . time() . "','" . $drn . "','cat','','','','" . $rusn . "','');");
            $categ = mysql_query("select * from `download` where type = 'cat' and name='{$drn}' and refid = '" . $cat . "';");
            $newcat = mysql_fetch_array($categ);
            echo "&#187;<a href='?cat=" . $newcat[id] . "'>В папку</a><br/>";
        } else {
            echo "ERROR<br/>";
        }
    } else {
        echo "<form action='?act=makdir&amp;cat=" . intval($_GET['cat']) . "' method='post'>\n         <p>" . $lng_dl['folder_name'] . "<br />\n         <input type='text' name='drn'/></p>\n         <p>" . $lng_dl['folder_name_for_list'] . ":<br/>\n         <input type='text' name='rusn'/></p>\n         <p><input type='submit' name='submit' value='Создать'/></p>\n         </form>";
    }
}
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:makdir.php

示例7: mysql_fetch_assoc

 $ms = mysql_fetch_assoc($typ);
 if ($ms[type] != "t") {
     require '../incfiles/head.php';
     echo functions::display_error($lng['error_wrong_data']);
     require '../incfiles/end.php';
     exit;
 }
 if (isset($_POST['submit'])) {
     $nn = isset($_POST['nn']) ? functions::check($_POST['nn']) : false;
     if (!$nn) {
         require '../incfiles/head.php';
         echo functions::display_error($lng_forum['error_topic_name'], '<a href="index.php?act=ren&amp;id=' . $id . '">' . $lng['repeat'] . '</a>');
         require '../incfiles/end.php';
         exit;
     }
     $bz = isset($_POST['bz']) ? functions::check($_POST['bz']) : false;
     if (!$bz) {
         require '../incfiles/head.php';
         echo functions::display_error($lng_forum['error_topic_name'], '<a href="index.php?act=ren&amp;id=' . $id . '">' . $lng['repeat'] . '</a>');
         require '../incfiles/end.php';
         exit;
     }
     // Periksa apakah ada topik dengan nama yang sama?
     $pt = mysql_query("SELECT * FROM `forum` WHERE `type` = 't' AND `refid` = '" . $ms['refid'] . "' and text='{$nn}' LIMIT 1");
     if (mysql_num_rows($pt) != 0) {
         require '../incfiles/head.php';
         echo functions::display_error($lng_forum['error_topic_exists'], '<a href="index.php?act=ren&amp;id=' . $id . '">' . $lng['repeat'] . '</a>');
         require '../incfiles/end.php';
         exit;
     }
     mysql_query("update `forum` set  text='" . $nn . "',tiento='" . $bz . "' where id='" . $id . "';");
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:ren.php

示例8: strtok

    if (isset($_POST['submit'])) {
        // Проверка на флуд
        $flood = functions::antiflood();
        if ($flood) {
            require_once '../incfiles/head.php';
            echo functions::display_error('Вы не можете так часто добавлять сообщения<br />Пожалуйста, подождите ' . $flood . ' сек.', '<a href="index.php?act=komm&amp;id=' . $id . '">Назад</a>');
            require_once '../incfiles/end.php';
            exit;
        }
        if ($_POST['msg'] == "") {
            require_once "../incfiles/head.php";
            echo "Вы не ввели сообщение!<br/><a href='?act=komm&amp;id=" . $id . "'>К комментариям</a><br/>";
            require_once '../incfiles/end.php';
            exit;
        }
        $msg = functions::check($_POST['msg']);
        if ($_POST[msgtrans] == 1) {
            $msg = functions::trans($msg);
        }
        $msg = mb_substr($msg, 0, 500);
        $agn = strtok($agn, ' ');
        mysql_query("insert into `download` values(0,'{$id}','','" . time() . "','','komm','{$login}','" . long2ip($ip) . "','" . $agn . "','" . $msg . "','');");
        $fpst = $datauser['komm'] + 1;
        mysql_query("UPDATE `users` SET\n\t\t`komm`='" . $fpst . "',\n\t\t`lastpost` = '" . time() . "'\n\t\tWHERE `id`='" . $user_id . "'");
        header("Location: index.php?act=komm&id={$id}");
    } else {
        require_once "../incfiles/head.php";
        echo "Напишите комментарий<br/><br/><form action='?act=addkomm&amp;id=" . $id . "' method='post'>\nCообщение(max. 500)<br/>\n<textarea rows='3' title='Введите комментарий' name='msg' ></textarea><br/><br/>\n<input type='checkbox' name='msgtrans' value='1' title='Поставьте флажок для транслитерации сообщения' /> Транслит<br/>\n<input type='submit' title='Нажмите для отправки' name='submit' value='добавить' />\n  </form><br/>";
        echo '<a href="index.php?act=trans">Транслит</a><br /><a href="../str/smile.php">' . $lng['smileys'] . '</a><br/>';
    }
} else {
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:addkomm.php

示例9: mysql_query

 Редактирование выбранной категории, или раздела
 -----------------------------------------------------------------
 */
 if (!$id) {
     echo functions::display_error($lng['error_wrong_data'], '<a href="index.php?act=forum">' . $lng_forum['forum_management'] . '</a>');
     require '../incfiles/end.php';
     exit;
 }
 $req = mysql_query("SELECT * FROM `forum` WHERE `id` = '{$id}'");
 if (mysql_num_rows($req)) {
     $res = mysql_fetch_assoc($req);
     if ($res['type'] == 'f' || $res['type'] == 'r') {
         if (isset($_POST['submit'])) {
             // Принимаем данные
             $name = isset($_POST['name']) ? functions::check($_POST['name']) : '';
             $desc = isset($_POST['desc']) ? functions::check($_POST['desc']) : '';
             $category = isset($_POST['category']) ? intval($_POST['category']) : 0;
             // проверяем на ошибки
             $error = array();
             if ($res['type'] == 'r' && !$category) {
                 $error[] = $lng_forum['error_category_select'];
             } elseif ($res['type'] == 'r' && !mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `id` = '{$category}' AND `type` = 'f'"), 0)) {
                 $error[] = $lng_forum['error_category_select'];
             }
             if (!$name) {
                 $error[] = $lng['error_empty_title'];
             }
             if ($name && (mb_strlen($name) < 2 || mb_strlen($name) > 30)) {
                 $error[] = $lng['title'] . ': ' . $lng['error_wrong_lenght'];
             }
             if ($desc && mb_strlen($desc) < 2) {
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:forum.php

示例10: mysql_query

             echo functions::display_error($lng['error_wrong_data']);
             require_once '../incfiles/end.php';
             exit;
         }
         mysql_query("UPDATE `cms_counters` SET\n            `name` = '" . functions::check($name) . "',\n            `link1` = '" . mysql_real_escape_string($link1) . "',\n            `link2` = '" . mysql_real_escape_string($link2) . "',\n            `mode` = '{$mode}'\n            WHERE `id` = '{$id}'");
     } else {
         // Получаем значение сортировки
         $req = mysql_query("SELECT `sort` FROM `cms_counters` ORDER BY `sort` DESC LIMIT 1");
         if (mysql_num_rows($req) > 0) {
             $res = mysql_fetch_array($req);
             $sort = $res['sort'] + 1;
         } else {
             $sort = 1;
         }
         // Режим добавления
         mysql_query("INSERT INTO `cms_counters` SET\n            `name` = '" . functions::check($name) . "',\n            `sort` = '{$sort}',\n            `link1` = '" . mysql_real_escape_string($link1) . "',\n            `link2` = '" . mysql_real_escape_string($link2) . "',\n            `mode` = '{$mode}'");
     }
     echo '<div class="gmenu"><p>' . ($id ? $lng['counter_edit_conf'] : $lng['counter_add_conf']) . '</p></div>';
     break;
 default:
     /*
     -----------------------------------------------------------------
     Вывод списка счетчиков
     -----------------------------------------------------------------
     */
     echo '<div class="phdr"><a href="index.php"><b>' . $lng['admin_panel'] . '</b></a> | ' . $lng['counters'] . '</div>';
     $req = mysql_query("SELECT * FROM `cms_counters` ORDER BY `sort` ASC");
     if (mysql_num_rows($req)) {
         $i = 0;
         while ($res = mysql_fetch_assoc($req)) {
             echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:counters.php

示例11: intval

require_once "../incfiles/head.php";
if ($rights == 4 || $rights >= 6) {
    if ($_GET['file'] == "") {
        echo $lng_dl['file_not_selected'] . "<br/><a href='?'>" . $lng['back'] . "</a><br/>";
        require_once '../incfiles/end.php';
        exit;
    }
    $file = intval($_GET['file']);
    $file1 = mysql_query("SELECT * FROM `download` WHERE `type` = 'file' AND `id` = '" . $file . "';");
    $file2 = mysql_num_rows($file1);
    $adrfile = mysql_fetch_array($file1);
    if ($file1 == 0 || !is_file("{$adrfile['adres']}/{$adrfile['name']}")) {
        echo $lng_dl['file_not_selected'] . "<br/><a href='?'>" . $lng['back'] . "</a><br/>";
        require_once '../incfiles/end.php';
        exit;
    }
    $stt = "{$adrfile['text']}";
    if (isset($_POST['submit'])) {
        $newt = functions::check($_POST['newt']);
        mysql_query("update `download` set `text`='" . $newt . "' where `id`='" . $file . "';");
        echo $lng_dl['description_changed'] . "<br/>";
    } else {
        $str = str_replace("<br/>", "\r\n", $adrfile['text']);
        echo "<form action='?act=opis&amp;file=" . $file . "' method='post'>";
        echo $lng['description'] . ':<br/><textarea rows="4" name="newt">' . $str . '</textarea><br/>';
        echo "<input type='submit' name='submit' value='Изменить'/></form><br/>";
    }
} else {
    echo "Нет доступа!";
}
echo "<p><a href='?act=view&amp;file=" . $file . "'>" . $lng['back'] . "</a></p>";
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:opis.php

示例12: mysql_query

     mysql_query("UPDATE `forum` SET\n            `refid` = '{$razd}'\n            WHERE `id` = '{$id}'\n        ");
     header("Location: index.php?id={$id}");
 } else {
     /*
     -----------------------------------------------------------------
     Перенос темы
     -----------------------------------------------------------------
     */
     $ms = mysql_fetch_assoc($typ);
     require '../incfiles/head.php';
     if (empty($_GET['other'])) {
         $rz = mysql_query("select * from `forum` where id='" . $ms['refid'] . "';");
         $rz1 = mysql_fetch_assoc($rz);
         $other = $rz1['refid'];
     } else {
         $other = intval(functions::check($_GET['other']));
     }
     $fr = mysql_query("select * from `forum` where id='" . $other . "';");
     $fr1 = mysql_fetch_assoc($fr);
     echo '<div class="phdr"><a href="index.php?id=' . $id . '"><b>' . $lng['forum'] . '</b></a> | ' . $lng_forum['topic_move'] . '</div>' . '<form action="index.php?act=per&amp;id=' . $id . '" method="post">' . '<div class="gmenu"><p>' . '<h3>' . $lng['category'] . '</h3>' . $fr1['text'] . '</p>' . '<p><h3>' . $lng['section'] . '</h3>' . '<select name="razd">';
     $raz = mysql_query("SELECT * FROM `forum` WHERE `refid` = '{$other}' AND `type` = 'r' AND `id` != '" . $ms['refid'] . "' ORDER BY `realid` ASC");
     while ($raz1 = mysql_fetch_assoc($raz)) {
         echo '<option value="' . $raz1['id'] . '">' . $raz1['text'] . '</option>';
     }
     echo '</select></p>' . '<p><input type="submit" name="submit" value="' . $lng['move'] . '"/></p>' . '</div></form>' . '<div class="phdr">' . $lng_forum['other_categories'] . '</div>';
     $frm = mysql_query("SELECT * FROM `forum` WHERE `type` = 'f' AND `id` != '{$other}' ORDER BY `realid` ASC");
     while ($frm1 = mysql_fetch_assoc($frm)) {
         echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
         echo '<a href="index.php?act=per&amp;id=' . $id . '&amp;other=' . $frm1['id'] . '">' . $frm1['text'] . '</a></div>';
         ++$i;
     }
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:per.php

示例13: mysql_query

    if (empty($error)) {
        mysql_query("INSERT INTO `cms_mail` SET\n\t\t`user_id` = '" . $user_id . "',\n\t\t`from_id` = '" . $id . "',\n\t\t`text` = '" . mysql_real_escape_string($text) . "',\n\t\t`time` = '" . time() . "',\n\t\t`file_name` = '" . mysql_real_escape_string($newfile) . "',\n\t\t`size` = '" . $sizefile . "'") or die(mysql_error());
        mysql_query("UPDATE `users` SET `lastpost` = '" . time() . "' WHERE `id` = '{$user_id}';");
        if ($ch == 0) {
            mysql_query("UPDATE `cms_contact` SET `time` = '" . time() . "' WHERE `user_id` = '" . $user_id . "' AND\n\t\t\t`from_id` = '" . $id . "';");
            mysql_query("UPDATE `cms_contact` SET `time` = '" . time() . "' WHERE `user_id` = '" . $id . "' AND\n\t\t\t`from_id` = '" . $user_id . "';");
        }
        Header('Location: index.php?act=write' . ($id ? '&id=' . $id : ''));
        exit;
    } else {
        $out .= '<div class="rmenu">' . implode('<br />', $error) . '</div>';
    }
}
if (!functions::is_ignor($id) && empty($ban['1']) && empty($ban['3'])) {
    $out .= isset($_SESSION['error']) ? $_SESSION['error'] : '';
    $out .= '<div class="gmenu">' . '<form name="form" action="index.php?act=write' . ($id ? '&amp;id=' . $id : '') . '" method="post"  enctype="multipart/form-data">' . ($id ? '' : '<p><input type="text" name="nick" maxlength="15" value="' . (!empty($_POST['nick']) ? functions::check($_POST['nick']) : '') . '" placeholder="' . $lng_mail['to_whom'] . '?"/></p>') . '<p>';
    if (!$is_mobile) {
        $out .= bbcode::auto_bb('form', 'text');
    }
    $out .= '<textarea rows="' . $set_user['field_h'] . '" name="text"></textarea></p>';
    if ($set_user['translit']) {
        $out .= '<input type="checkbox" name="msgtrans" value="1" ' . (isset($_POST['msgtrans']) ? 'checked="checked" ' : '') . '/> ' . $lng['translit'] . '<br />';
    }
    $out .= '<p><input type="file" name="fail" style="width: 100%; max-width: 160px"/></p>';
    $out .= '<p><input type="submit" name="submit" value="' . $lng['sent'] . '"/></p>' . '</form></div>' . '<div class="phdr"><b>' . ($id && isset($qs) ? $lng_mail['personal_correspondence'] . ' ' . $qs['name'] : $lng_mail['sending_the_message']) . '</b></div>';
}
if ($id) {
    $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_mail` WHERE ((`user_id`='{$id}' AND `from_id`='{$user_id}') OR (`user_id`='{$user_id}' AND `from_id`='{$id}')) AND `sys`!='1' AND `delete`!='{$user_id}' AND `spam`='0'"), 0);
    if ($total) {
        if ($total > $kmess) {
            $out .= '<div class="topmenu">' . functions::display_pagination('index.php?act=write&amp;id=' . $id . '&amp;', $start, $total, $kmess) . '</div>';
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:write.php

示例14: mysql_query

echo '<div class="phdr"><a href="index.php"><b>' . $lng['admin_panel'] . '</b></a> | ' . $lng['site_settings'] . '</div>';
if (isset($_POST['submit'])) {
    /*
    -----------------------------------------------------------------
    Сохраняем настройки системы
    -----------------------------------------------------------------
    */
    mysql_query("UPDATE `cms_settings` SET `val`='" . functions::check($_POST['skindef']) . "' WHERE `key` = 'skindef'");
    mysql_query("UPDATE `cms_settings` SET `val`='" . mysql_real_escape_string(htmlspecialchars($_POST['madm'])) . "' WHERE `key` = 'email'");
    mysql_query("UPDATE `cms_settings` SET `val`='" . intval($_POST['timeshift']) . "' WHERE `key` = 'timeshift'");
    mysql_query("UPDATE `cms_settings` SET `val`='" . functions::check($_POST['copyright']) . "' WHERE `key` = 'copyright'");
    mysql_query("UPDATE `cms_settings` SET `val`='" . functions::check(preg_replace("#/\$#", '', trim($_POST['homeurl']))) . "' WHERE `key` = 'homeurl'");
    mysql_query("UPDATE `cms_settings` SET `val`='" . intval($_POST['flsz']) . "' WHERE `key` = 'flsz'");
    mysql_query("UPDATE `cms_settings` SET `val`='" . isset($_POST['gz']) . "' WHERE `key` = 'gzip'");
    mysql_query("UPDATE `cms_settings` SET `val`='" . functions::check($_POST['meta_key']) . "' WHERE `key` = 'meta_key'");
    mysql_query("UPDATE `cms_settings` SET `val`='" . functions::check($_POST['meta_desc']) . "' WHERE `key` = 'meta_desc'");
    $req = mysql_query("SELECT * FROM `cms_settings`");
    $set = array();
    while ($res = mysql_fetch_row($req)) {
        $set[$res[0]] = $res[1];
    }
    echo '<div class="rmenu">' . $lng['settings_saved'] . '</div>';
}
/*
-----------------------------------------------------------------
Форма ввода параметров системы
-----------------------------------------------------------------
*/
echo '<form action="index.php?act=settings" method="post"><div class="menu">';
// Общие настройки
echo '<p>' . '<h3>' . $lng['common_settings'] . '</h3>' . $lng['site_url'] . ':<br/>' . '<input type="text" name="homeurl" value="' . htmlentities($set['homeurl']) . '"/><br/>' . $lng['site_copyright'] . ':<br/>' . '<input type="text" name="copyright" value="' . htmlentities($set['copyright'], ENT_QUOTES, 'UTF-8') . '"/><br/>' . $lng['site_email'] . ':<br/>' . '<input name="madm" maxlength="50" value="' . htmlentities($set['email']) . '"/><br />' . $lng['file_maxsize'] . ' (kb):<br />' . '<input type="text" name="flsz" value="' . intval($set['flsz']) . '"/><br />' . '<input name="gz" type="checkbox" value="1" ' . ($set['gzip'] ? 'checked="checked"' : '') . ' />&#160;' . $lng['gzip_compress'] . '</p>';
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:settings.php

示例15: define

* @version     VERSION.txt (see attached file)
* @author      http://johncms.com/about
* @dev		    agssbuzz@catroxs.org
			    http://www.catroxs.org
*/
define('_IN_JOHNCMS', 1);
$rootpath = '';
$headmod = 'login';
require 'incfiles/core.php';
require 'incfiles/head.php';
echo '<div class="phdr"><b>' . $lng['login'] . '</b></div>';
$error = array();
$captcha = FALSE;
$display_form = 1;
$user_login = isset($_POST['n']) ? functions::check($_POST['n']) : NULL;
$user_pass = isset($_REQUEST['p']) ? functions::check($_REQUEST['p']) : NULL;
$user_mem = isset($_POST['mem']) ? 1 : 0;
$user_code = isset($_POST['code']) ? trim($_POST['code']) : NULL;
if ($user_pass && !$user_login && !$id) {
    $error[] = $lng['error_login_empty'];
}
if (($user_login || $id) && !$user_pass) {
    $error[] = $lng['error_empty_password'];
}
if ($user_login && (mb_strlen($user_login) < 2 || mb_strlen($user_login) > 20)) {
    $error[] = $lng['nick'] . ': ' . $lng['error_wrong_lenght'];
}
if ($user_pass && (mb_strlen($user_pass) < 3 || mb_strlen($user_pass) > 15)) {
    $error[] = $lng['password'] . ': ' . $lng['error_wrong_lenght'];
}
if (!$error && $user_pass && ($user_login || $id)) {
开发者ID:chegestar,项目名称:catroxs,代码行数:31,代码来源:login.php


注:本文中的functions::check方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。