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


PHP security::checknullwithoutwhitespace方法代码示例

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


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

示例1: user

include "php/user.php";
include "php/security.php";
include "php/manager.php";
$login = new user();
$sec = new security();
$manager = new manager();
$logincheck = $login->islogin();
if ($logincheck != 1) {
    header("location: index.php");
} else {
    if (isset($_GET['error'])) {
        $error = $_GET['error'];
    }
    if ($_SERVER['REQUEST_METHOD'] == "POST") {
        $managername = $sec->escape($_POST['managername']);
        $managerlength = $sec->checknullwithoutwhitespace($managername);
        $managerage = $sec->escape($_POST['managerage']);
        $managermail = $sec->escape($_POST['managermail']);
        $manageraddress = $sec->escape($_POST['manageraddress']);
        if ($managerlength != 0) {
            $ans = $manager->addmanager($managername, $managerage, $managermail, $manageraddress);
            if ($ans == 0) {
                $error = "نام مدیر نباید تکراری باشد";
            } else {
                $error = "مدیر با موفقیت ایجاد شد";
            }
        } else {
            $error = "لطفا ابتدا نام مدیر را وارد کنید";
        }
    }
}
开发者ID:padratec,项目名称:school-last,代码行数:31,代码来源:managers.php

示例2: header

$name;
$address;
$telephone;
if ($_SERVER["REQUEST_METHOD"] == "GET") {
    if (isset($_GET['id'])) {
        $result = $school->getschoolbyid($_GET['id']);
        $row = $result->fetch_assoc();
        $name = $row['Sname'];
        $address = $row['Address'];
        $telephone = $row['Telephone'];
    }
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $id = $sec->escape($_POST['schoolid']);
    $schoolname = $sec->escape($_POST["schoolname"]);
    $schoollength = $sec->checknullwithoutwhitespace($schoolname);
    $schooladdress = $sec->escape($_POST["schooladdress"]);
    $schooltel = $sec->escape($_POST["schooltel"]);
    if ($schoollength != 0) {
        $ans = $school->editschool($id, $schoolname, $schooladdress, $schooltel);
        if ($ans == 1) {
            $error = "نام مدرسه نباید تکراری باشد";
        } else {
            $error = "مدرسه با موفقیت ویرایش شد";
        }
    } else {
        $error = "لطفا ابتدا نام مدرسه را وارد کنید";
    }
    header("location: editschool.php?id={$id}&error={$error}");
}
?>
开发者ID:padratec,项目名称:school-last,代码行数:31,代码来源:editschool.php


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