• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP validation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: forgotPwd

function forgotPwd()
{
    global $req;
    global $connection;
    global $module;
    $req->hasParams("email");
    $email = $req->getParam("email");
    $POST = array('email' => $email);
    $val = new validation();
    $val->addSource($POST);
    $val->addRule('email', 'email', true, 2, 100, true);
    $val->run();
    if (sizeof($val->errors) > 0) {
        $connection->close();
        $errors = implode(" <br/> ", $val->errors);
        Res::sendInvalid("Error: " . $errors);
    } else {
        $POST = $val->sanitized;
        $email = $module->escape($POST['email']);
        $output = $module->forgotPwd($email);
        if (is_bool($output)) {
            Res::sendInvalid($module->message);
        } else {
            $res = new Res();
            $res->send();
        }
    }
}
开发者ID:ashutoshSce,项目名称:adminPanel,代码行数:28,代码来源:adminLogin.php


示例2: dologinAction

 public function dologinAction()
 {
     Db::connect();
     $bean = R::dispense('user');
     // the redbean model
     $required = ['Name' => 'name', 'Email' => 'email', 'User_Name' => ['rmnl', 'az_lower'], 'Password' => 'password_hash'];
     \RedBeanFVM\RedBeanFVM::registerAutoloader();
     // for future use
     $fvm = \RedBeanFVM\RedBeanFVM::getInstance();
     $fvm->generate_model($bean, $required);
     //the magic
     R::store($bean);
     $val = new validation();
     $val->addSource($_POST)->addRule('email', 'email', true, 1, 255, true)->addRule('password', 'string', true, 10, 150, false);
     $val->run();
     if (count($val->errors)) {
         Debug::r($val->errors);
         foreach ($val->errors as $error) {
             Notification::setMessage($error, Notification::TYPE_ERROR);
         }
         $this->redirect(Request::createUrl('login', 'login'));
     } else {
         Notification::setMessage("Welcome back !", Notification::TYPE_SUCCESS);
         Debug::r($val->sanitized);
         session::set('user', ['sanil']);
         $this->redirect(Request::createUrl('index', 'index'));
     }
 }
开发者ID:santonil2004,项目名称:ovc,代码行数:28,代码来源:loginController.php


示例3: _validate

 public function _validate($data, $rules_array = array())
 {
     $val = new validation();
     $val->addSource($data);
     $val->AddRules($rules_array);
     $val->run();
     // exit();
     if (sizeof($val->errors) > 0) {
         $this->valid = false;
         return $val->errors;
     } else {
         $this->valid = true;
         return $val->sanitized;
     }
 }
开发者ID:pqzada,项目名称:wp-test,代码行数:15,代码来源:Model.php


示例4: validate

 public static function validate()
 {
     $val = validation::forge();
     $val->add_field('Cname', 'カレッジ名', 'required');
     $val->add_field('Ckana', 'カレッジ名(カナ)', 'required');
     return $val;
 }
开发者ID:nihonLoomba,项目名称:noteshare-,代码行数:7,代码来源:college.php


示例5: validation

 /**
  * Short description of method instance
  *
  * @access public
  * @author Jean-Francois Levesque, <[email protected]>
  * @return void
  */
 public static function &instance()
 {
     if (!validation::$instance) {
         validation::$instance = new validation();
     }
     return validation::$instance;
 }
开发者ID:Gwagz,项目名称:stationnement_aep,代码行数:14,代码来源:class.validation.php


示例6: validate

 public static function validate()
 {
     $val = validation::forge();
     $val->add_field('college', 'College', 'required');
     $val->add_field('Did', 'Depart(略称)', 'required');
     $val->add_field('Dname', 'Depart', 'required');
     $val->add_field('Dkana', 'Depart(カナ)', 'required');
     return $val;
 }
开发者ID:nihonLoomba,项目名称:noteshare-,代码行数:9,代码来源:galtuka.php


示例7: validate

 public static function validate()
 {
     $val = validation::forge();
     //バリデーションフィールドの追加
     $val->add_field('cla', 'クラス', 'required|max_length[20]');
     $val->add_field('title', 'タイトル', 'required');
     $val->add_field('Pcontent', '内容', 'required|max_length[200]');
     return $val;
 }
开发者ID:nihonLoomba,项目名称:noteshare-,代码行数:9,代码来源:post.php


示例8: validate

 public static function validate()
 {
     $val = validation::forge();
     //バリデーションフィールドの追加
     $val->add_field('username', 'ユーザID', 'required|max_length[9]');
     $val->add_field('name', 'ユーザ名', 'required|max_length[50]');
     $val->add_field('password', 'パスワード', 'required|min_length[4]|max_length[20]');
     $val->add_field('email', 'Eメール', 'required|valid_email');
     $val->add_field('class', 'クラス', 'required');
     return $val;
 }
开发者ID:nihonLoomba,项目名称:noteshare-,代码行数:11,代码来源:users.php


示例9: validate_admin

 public static function validate_admin()
 {
     if (isset($_POST['submit'])) {
         $required_fields = array("username", "password");
         validation::validate_presentces($required_fields);
         $fields_with_max_lengths = array("password" => 30);
         validation::validate_max_lengths($fields_with_max_lengths);
         return empty(validation::$errors) ? true : false;
     } else {
         return false;
     }
 }
开发者ID:vincentywang,项目名称:simplenote,代码行数:12,代码来源:class.admin.inc.php


示例10: addUsers

function addUsers()
{
    global $req;
    global $connection;
    $req->hasParams("adminUName", "adminFName", "adminGender", "adminEMail", "adminPassword", "adminPhone");
    $adminUName = $req->getParam("adminUName");
    $adminFName = $req->getParam("adminFName");
    $adminGender = $req->getParam("adminGender");
    $adminEMail = $req->getParam("adminEMail");
    $adminPassword = $req->getParam("adminPassword");
    $adminPhone = $req->getParam("adminPhone");
    $POST = array('adminUName' => $adminUName, 'adminFName' => $adminFName, 'adminGender' => $adminGender, 'adminEMail' => $adminEMail, 'adminPassword' => $adminPassword, 'adminPhone' => $adminPhone);
    $genderValues = array('m', 'f', 'u');
    $val = new validation();
    $val->addSource($POST);
    $val->addRule('adminUName', 'string', true, 2, 50, true)->addRule('adminFName', 'string', true, 2, 50, true)->addRule('adminGender', 'string', true, 1, 1, true)->addRule('adminEMail', 'email', true, 5, 100, true)->addRule('adminPassword', 'string', true, 4, 35, true)->addRule('adminPhone', 'string', true, 4, 20, true);
    $val->run();
    if (sizeof($val->errors) > 0) {
        $errors = implode(" <br/> ", $val->errors);
        Res::sendInvalid("Errors:" . $errors);
    } else {
        $POST = $val->sanitized;
        $adminTable = new adminTable($connection);
        $adminUName = $adminTable->escape($POST['adminUName']);
        $adminFName = $adminTable->escape($POST['adminFName']);
        $adminGender = $adminTable->escape($POST['adminGender']);
        $adminEMail = $adminTable->escape($POST['adminEMail']);
        $adminPassword = $adminTable->escape($POST['adminPassword']);
        $adminPhone = $adminTable->escape($POST['adminPhone']);
        $adminId = $adminTable->insertUsers($adminUName, $adminFName, $adminGender, $adminEMail, $adminPassword, $adminPhone);
        if (is_bool($adminId)) {
            Res::sendInvalid("Errors:" . $adminTable->message);
        } else {
            $res = new Res();
            $res->addData("adminId", $adminId);
            $res->send();
        }
    }
}
开发者ID:ashutoshSce,项目名称:adminPanel,代码行数:39,代码来源:adminDashboard.php


示例11: login

 function login($user, $pwd, $rem)
 {
     global $adminSession;
     global $adminCookieUser;
     global $adminCookiePassword;
     global $invalidUserIdOrPassword;
     $POST = array('user' => $user, 'pwd' => $pwd, 'rem' => $rem);
     $val = new validation();
     $val->addSource($POST);
     $val->addRule('user', 'string', true, 1, 35, true)->addRule('pwd', 'string', true, 1, 35, true)->addRule('rem', 'bool');
     $val->run();
     if (sizeof($val->errors) > 0) {
         $connection->close();
         $errors = implode(" <br/> ", $val->errors);
         return "Error: " . $errors;
     } else {
         $POST = $val->sanitized;
         $user = $this->escape($POST['user']);
         $pwd = $this->escape($POST['pwd']);
         $rem = $this->escape($POST['rem']);
         $adminTable = new adminTable($this->connection);
         $result = $adminTable->verifyAdminLogin($user, $pwd);
         if (is_bool($result)) {
             return $invalidUserIdOrPassword;
         } else {
             if (!isset($_SESSION)) {
                 session_start();
             }
             $_SESSION[$adminSession] = $result;
             if ($rem) {
                 setcookie($adminCookieUser, $user, time() + 10 * 365 * 24 * 60 * 60, "/");
                 setcookie($adminCookiePassword, $pwd, time() + 10 * 365 * 24 * 60 * 60, "/");
             }
             return true;
         }
     }
 }
开发者ID:ashutoshSce,项目名称:adminPanel,代码行数:37,代码来源:adminLogin.php


示例12: edit_page

 /**
  * edit page according the passed page id
  * @param string $page_id
  * update session message
  */
 public static function edit_page($page_id)
 {
     global $dbo;
     if (isset($_POST['submit'])) {
         // validations
         $required_fields = array("menu_name", "position", "visible", "content");
         validation::validate_presentces($required_fields);
         $fields_with_max_lengths = array("menu_name" => 200, "description" => 500, "content" => 2000);
         validation::validate_max_lengths($fields_with_max_lengths);
         if (empty(validation::$errors)) {
             // process form perform update
             $id = $page_id;
             $subject_id = (int) $_POST["belong_subject"];
             $menu_name = $dbo->mysql_prep($_POST["menu_name"]);
             // Escape all strings
             $position = (int) $_POST["position"];
             $visible = (int) $_POST["visible"];
             $home_page = (int) $_POST["home_display"];
             $archive = (int) $_POST["archive_display"];
             $description = $dbo->mysql_prep($_POST["description"]);
             //$content = str_replace("&nbsp", "", );
             $content = $dbo->mysql_prep($_POST["content"]);
             // perform database query
             $query = "UPDATE pages SET ";
             $query .= "subject_id = '{$subject_id}', ";
             $query .= "menu_name = '{$menu_name}', ";
             $query .= "position = {$position}, ";
             $query .= "visible = {$visible}, ";
             $query .= "home_page = {$home_page}, ";
             $query .= "archive = {$archive}, ";
             $query .= "description = '{$description}', ";
             $query .= "content = '{$content}' ";
             $query .= "WHERE id = {$id}";
             $query .= " LIMIT 1";
             $result = self::find_by_sql($query);
         }
         if (isset($result) && $dbo->affected_rows($result) >= 0) {
             // success
             $_SESSION["message"] = "Page Updated.";
             utility::redirect_to("manage_content.php?page={$id}");
         } else {
             // failure
             $_SESSION["message"] = "Page update failed.";
         }
     } else {
         // This is probably a GET request
     }
 }
开发者ID:vincentywang,项目名称:simplenote,代码行数:53,代码来源:class.page.inc.php


示例13: create_comment

 /**
  * Create a comment
  * no return value, update $_SESSION message
  */
 public static function create_comment()
 {
     global $dbo;
     global $current_page;
     if (isset($_POST['submit'])) {
         // validations
         $required_fields = array("author", "body");
         validation::validate_presentces($required_fields);
         $fields_with_max_lengths = array("body" => 200);
         validation::validate_max_lengths($fields_with_max_lengths);
         if (empty(validation::$errors)) {
             // process form
             $page_id = $current_page['id'];
             $created = strftime("%Y-%m-%d %H-%M-%S", time());
             //	$created = time();	// store time stam or string
             $author = $dbo->mysql_prep($_POST["author"]);
             $body = $dbo->mysql_prep($_POST["body"]);
             // perform database query
             $query = "INSERT INTO comments (";
             $query .= " page_id, created, author, body";
             $query .= ") VALUES (";
             $query .= " {$page_id}, '{$created}', '{$author}', '{$body}'";
             $query .= ")";
             $result = $dbo->query($query);
             $dbo->confirm_query($result);
         }
         if (isset($result) && $dbo->affected_rows($result) >= 0) {
             // success
             $_SESSION["message"] = "comment created.";
             //utility::redirect_to("manage_admins.php");
         } else {
             // failure
             $_SESSION["message"] = "comment creation failed.";
         }
     } else {
         $_SESSION["message"] = "There is some problem.";
         // not a post submit
     }
 }
开发者ID:vincentywang,项目名称:simplenote,代码行数:43,代码来源:class.comment.inc.php


示例14: edit_subject

 /**
  * edit subject according to form submit
  * @param string $subject_id A field provide by user click edit button
  * 
  */
 public static function edit_subject($subject_id)
 {
     global $dbo;
     if (isset($_POST['submit'])) {
         // validations
         $required_fields = array("menu_name", "position", "visible");
         validation::validate_presentces($required_fields);
         $fields_with_max_lengths = array("menu_name" => 30);
         validation::validate_max_lengths($fields_with_max_lengths);
         if (empty(validation::$errors)) {
             // process form perform update
             $id = $subject_id;
             $menu_name = $dbo->mysql_prep($_POST["menu_name"]);
             // Escape all strings
             $position = (int) $_POST["position"];
             $visible = (int) $_POST["visible"];
             // perform database query
             $query = "UPDATE subjects SET ";
             $query .= "menu_name = '{$menu_name}', ";
             $query .= "position = {$position}, ";
             $query .= "visible = {$visible} ";
             $query .= "WHERE id = {$id}";
             $query .= " LIMIT 1";
             $result = $dbo->query($query);
         }
         if (isset($result) && $dbo->affected_rows($result) >= 0) {
             // success
             $_SESSION["message"] = "Subject Updated.";
             utility::redirect_to("manage_content.php");
         } else {
             // failure
             $_SESSION["message"] = "Subject updit failed.";
         }
     } else {
         // This is probably a GET request
     }
     // end: if(isset($_POST['submit']))
 }
开发者ID:vincentywang,项目名称:simplenote,代码行数:43,代码来源:class.subject.inc.php


示例15: Course

                 if ($users) {
                     $managerCourse->add(new Course(array('name' => $v1->sanitized['name'], 'description' => $v1->sanitized['desc'], 'pictureId' => isset($v1->sanitized['pictureId']) ? $v1->sanitized['pictureId'] : '', 'categories' => $cats, 'authors' => $users)));
                 } else {
                     $error_course_add = $tr->__("Please select at least one author");
                 }
             } else {
                 $error_course_add = $tr->__("Please select at least one category");
             }
         }
     } else {
         $error_course_add = $tr->__("Please select a category");
     }
 }
 if (isset($_POST['remove'])) {
     if (isset($_POST['id']) && !empty($_POST['id'])) {
         $v1 = new validation();
         $rules = array();
         $v1->addSource($_POST['id']);
         for ($i = 0; $i < count($_POST['id']); ++$i) {
             $rules[] = array('type' => 'numeric', "required" => true, 'min' => '0', 'max' => '10000', 'trim' => true);
         }
         $v1->AddRules($rules);
         $v1->run();
         foreach ($v1->sanitized as $id) {
             if ($managerCourse->hasActivities($id)) {
                 $v1->errors['HasLesson'] = $tr->__('The course you want to remove is attached to one or more lessons. Please, first delete these lessons');
                 break;
             }
         }
         if (sizeof($v1->errors) > 0) {
             $error_course_remove = $v1->getMessageErrors();
开发者ID:Cossumo,项目名称:studypress,代码行数:31,代码来源:course.controller.php


示例16: array

                $mailbody = $artical;
                $headers = "MIME-Version: 1.0\r\n";
                $headers .= "Content-type: text/html\r\n";
                $headers .= FROMEMAILADDRESS;
                @mail(base64_decode($sel_project_backer_user['emailAddress']), $subject, $mailbody, $headers);
            }
        }
        $_SESSION['msgType'] = array('from' => 'user', 'type' => 'error', 'var' => "multiple", 'val' => "Update Added Successfully");
        redirect(SITE_URL . "browseproject/" . $_GET['projectId'] . "/" . Slug($sel_project_name['projectTitle']) . "/&update=" . $num_of_rows . "#b");
    }
}
if (isset($_POST['submitUpdate']) && isset($_GET['projectId']) && $_GET['projectId'] != '' && isset($_POST['operation']) && $_POST['operation'] != '') {
    //echo $_GET['projectId'];exit;
    //echo 'edit';exit;
    extract($_POST);
    $obj = new validation();
    $obj->add_fields($updateTitle, 'req', 'Please Enter Title Of Update');
    $error = $obj->validate();
    if ($_POST['content'] == '') {
        $error .= "Please Enter Content" . '<br>';
    }
    if ($_POST['content'] != '') {
        $sel_projectupdateno = mysql_fetch_assoc($con->recordselect("SELECT count(*) as total FROM projectupdate WHERE projectId='" . $_GET['projectId'] . "'"));
        $num_of_rows = $sel_projectupdateno['total'] + 1;
        $currentTime = time();
        $textcontent = unsanitize_string($content);
        //$textcontent= trim(strip_tags($content));
        //echo 'abc'.$updateTitle;exit;
        //echo 'aaaa'.$updateTitle;exit;
        //echo "UPDATE projectupdate SET updateTitle='".sanitize_string($updateTitle)."' AND updateDescription='".$textcontent."' WHERE projectupdateId='".$_GET['projectId']."'";exit;
        $con->update("UPDATE projectupdate SET updateDescription='' WHERE projectupdateId='" . $_GET['projectId'] . "'");
开发者ID:centaurustech,项目名称:base-system,代码行数:31,代码来源:projectupdate.php


示例17: tu_validation

/**
 * Проверка данных из формы.
 */
function tu_validation(&$tservice, $is_exist_feedbacks = 0)
{
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/tservices/tservices_categories.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/tservices/validation.php';
    $errors = array();
    $validator = new validation();
    $tservices_categories = new tservices_categories();
    //---
    //$tservice->title = trim(htmlspecialchars(InPost('title'),ENT_QUOTES,'cp1251'));
    //$tservice->title = antispam(__paramInit('string', NULL, 'name', NULL, 60, TRUE));
    $tservice->title = sentence_case(__paramInit('html', null, 'title', null, 100, true));
    $title = trim(stripslashes(InPost('title')));
    if (!$validator->required($title)) {
        $errors['title'] = validation::VALIDATION_MSG_REQUIRED;
    } elseif (!$validator->symbols_interval($title, 4, 100)) {
        $errors['title'] = sprintf(validation::VALIDATION_MSG_SYMBOLS_INTERVAL, 4, 100);
    }
    //---
    $tservice->price = intval(trim(InPost('price')));
    if (!$validator->is_natural_no_zero($tservice->price)) {
        $errors['price'] = validation::VALIDATION_MSG_REQUIRED_PRICE;
    } elseif (!$validator->greater_than_equal_to($tservice->price, 300)) {
        $errors['price'] = sprintf(validation::VALIDATION_MSG_PRICE_GREATER_THAN_EQUAL_TO, '300 р.');
    } elseif (!$validator->less_than_equal_to($tservice->price, 999999)) {
        $errors['price'] = sprintf(validation::VALIDATION_MSG_PRICE_LESS_THAN_EQUAL_TO, '999 999 р.');
    }
    //---
    $days_db_id = intval(trim(InPost('days_db_id')));
    if (!$validator->is_natural_no_zero($days_db_id) || !in_array($days_db_id, array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, 21, 30, 45, 60, 90))) {
        $errors['days'] = validation::VALIDATION_MSG_FROM_LIST;
        $days_db_id = 1;
    }
    $tservice->days = $days_db_id;
    //---
    //Если есть отзывы то не даем изменить категорию
    if (!(InPost('action') == 'save' && $is_exist_feedbacks > 0)) {
        $category_id = intval(trim(InPost('category_db_id')));
        $parent_category_id = $tservices_categories->getCategoryParentId($category_id);
        if ($parent_category_id === false) {
            $errors['category'] = validation::VALIDATION_MSG_CATEGORY_FROM_LIST;
        } else {
            $tservice->category_id = $category_id;
            //$this->property()->parent_category_id = $parent_category_id;
        }
    }
    //---
    $str_tags = trim(preg_replace('/\\s+/s', ' ', strip_tags(InPost('tags'))));
    $tags = strlen($str_tags) > 0 ? array_unique(array_map('trim', explode(',', $str_tags))) : array();
    $tags = array_filter($tags, function ($el) {
        $len = strlen(stripslashes($el));
        return $len < 80 && $len > 2;
    });
    $tags_cnt = count(array_unique(array_map('strtolower', $tags)));
    $tags = array_map(function ($value) {
        return htmlspecialchars($value, ENT_QUOTES, 'cp1251');
    }, $tags);
    $tservice->tags = $tags;
    if (!$validator->required($str_tags)) {
        $errors['tags'] = validation::VALIDATION_MSG_REQUIRED;
    } elseif ($tags_cnt > 10) {
        $errors['tags'] = sprintf(validation::VALIDATION_MSG_MAX_TAGS, 10);
    }
    //---
    $videos = __paramInit('array', null, 'videos', array());
    $videos = is_array($videos) ? array_values($videos) : array();
    if (count($videos)) {
        $tservice->videos = null;
        foreach ($videos as $key => $video) {
            if ($validator->required($video)) {
                $_video_data = array('url' => $video, 'video' => false, 'image' => false);
                //$_video = $validator->video_validate($video);
                $_video = $validator->video_validate($video);
                $is_error = true;
                if ($_video) {
                    $_video_data['url'] = $_video;
                    if ($_video_meta = $validator->video_validate_with_thumbs($_video, 0)) {
                        $_video_data = array_merge($_video_data, $_video_meta);
                        $is_error = false;
                    }
                }
                if ($is_error) {
                    $errors['videos'][$key] = validation::VALIDATION_MSG_BAD_LINK;
                }
                $tservice->videos[$key] = $_video_data;
            }
        }
    }
    //---
    //$tservice->description = trim(htmlspecialchars(InPost('description'),ENT_QUOTES, "cp1251"));
    //$description = trim(InPost('description'));
    $tservice->description = trim(__paramInit('html', null, 'description', null, 5000, true));
    $description = trim(stripslashes(InPost('description')));
    if (!$validator->required($description)) {
        $errors['description'] = validation::VALIDATION_MSG_REQUIRED;
    } elseif (!$validator->symbols_interval($description, 4, 5000)) {
        $errors['description'] = sprintf(validation::VALIDATION_MSG_SYMBOLS_INTERVAL, 4, 5000);
//.........这里部分代码省略.........
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:101,代码来源:functions.php


示例18: extract

<?php

/*************************************************************************************************************
#Description : This Code is used to Manage Pages
*************************************************************************************************************/
extract($_GET);
extract($_POST);
$obj_setting = new common();
$obj = new validation();
$path = LIST_ROOT . '/images/home/banner/';
#Code to Fetch page category data
#END
$publish = 1;
/* Get Current Date Time Stamp */
$currentTimestamp = getCurrentTimestamp();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $error = '';
    /*validate required fields*/
    $obj->add_fields($tabtitle, 'req', 'Please Enter Tab Title');
    if ($id == "") {
        $obj->add_fields($tabtitle, 'uniquevalue', 'Please Enter Unique Tab Title', array('content_page', "tab_title='" . mysql_real_escape_string($tabtitle) . "' and page_name= 'Logistique'"));
    } else {
        $obj->add_fields($tabtitle, 'uniquevalue', 'Please Enter Unique Tab Title', array('content_page', "tab_title='" . mysql_real_escape_string($tabtitle) . "' and page_name= 'Logistique' and id!=" . $id));
    }
    $obj->add_fields($content, 'req', 'Please Enter Content');
    if (!isset($_GET['id'])) {
        $obj->add_fields($_FILES['file']['name'], 'req', 'Please Upload Banner Image');
    }
    $obj->add_fields($_FILES['file'], 'ftype=jpg,gif,png', 'Please Upload Valid Banner Image');
    if ($_FILES['file']['name'] != "") {
        $obj->add_fields($_FILES['file'], "imgwh=251,207", "Please Upload Valid Banner Image(251pxX207px)");
开发者ID:pankajsinghjarial,项目名称:SYLC-NEWSITE,代码行数:31,代码来源:logistique_actiontabs_code.php


示例19: DomainManager

                echo $tr->__("This name already exist") . " !!";
            } else {
                echo "true";
            }
        }
    }
} else {
    if (!defined('ABSPATH')) {
        exit;
    }
    global $tr;
    $managerDomain = new DomainManager();
    $error_domain_add = "";
    $error_domain_remove = "";
    if (isset($_POST)) {
        $validation = new validation();
    }
    if (isset($_POST['add'])) {
        $validation->addSource($_POST);
        $validation->AddRules(array('name' => array('type' => 'string', "required" => true, 'min' => '1', 'max' => '200', 'trim' => true), 'desc' => array('type' => 'string', "required" => true, 'min' => '0', 'max' => '999999', 'trim' => true)));
        $validation->run();
        if (sizeof($validation->errors) > 0) {
            $error_domain_add = $validation->getMessageErrors();
        } else {
            $managerDomain->add(new Domain(array('name' => $validation->sanitized['name'], 'description' => $validation->sanitized['desc'])));
            if ($managerDomain->isError()) {
                $error_domain_add = $tr->__("This name already exist");
            }
        }
    }
    if (isset($_POST['remove'])) {
开发者ID:Cossumo,项目名称:studypress,代码行数:31,代码来源:domain.controller.php


示例20: extract

<?php

/*************************************************************************************************************
#Coder         : Kapil Verma
#Description : This Code is used to Manage Pages
*************************************************************************************************************/
extract($_GET);
extract($_POST);
$obj_setting = new common();
$obj = new validation();
#Code to Fetch page category data
#END
$publish = 1;
/* Get Current Date Time Stamp */
$currentTimestamp = getCurrentTimestamp();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $error = '';
    /*validate required fields*/
    $obj->add_fields($content, 'req', 'Please Enter Content');
    $error = $obj->validate();
    if ($error) {
        $errorMsg = "<font color='#FF0000' family='verdana' size=2>Please fill all required fields.</font>";
    } else {
        /*save welcome section content*/
        $dataArr = array('content' => $content);
        $banner_insert = $obj_setting->update('editor_rows', $dataArr, "id=1");
        $_SESSION['success_msg'] = 'Successfully Saved';
        echo '<script>location.href="' . DEFAULT_URL . '/superadmin/home/welcome.php";</script>';
        exit;
    }
}
开发者ID:pankajsinghjarial,项目名称:SYLC-NEWSITE,代码行数:31,代码来源:home_welcome_code.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP validator类代码示例发布时间:2022-05-23
下一篇:
PHP validater类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap