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


PHP validation::validate方法代码示例

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


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

示例1: array

                $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'] . "'");
        $con->update("UPDATE projectupdate SET updateDescription='" . addslashes($content) . "' WHERE projectupdateId='" . $_GET['projectId'] . "'");
        $con->update("UPDATE projectupdate SET updateTitle='" . sanitize_string($updateTitle) . "' WHERE projectupdateId='" . $_GET['projectId'] . "'");
开发者ID:centaurustech,项目名称:base-system,代码行数:31,代码来源:projectupdate.php

示例2: unset

     $obj->add_fields($drivetrain_other, 'req', 'Please Enter Drivetrainr%%drivetrain_other');
 }
 $obj->add_fields($doors, 'req', 'Please Select Doors%%doors');
 if ($doors == "other") {
     $obj->add_fields($doors_other, 'req', 'Please Enter Doors%%doors_other');
 }
 $obj->add_fields($wheelbase, 'req', 'Please Select Wheelbase%%wheelbase');
 if ($wheelbase == "other") {
     $obj->add_fields($wheelbase_other, 'req', 'Please Enter Wheelbase%%wheelbase_other');
 }
 $error_tab3 = $obj->validate();
 unset($obj);
 $obj = new validation();
 $obj->add_fields($features, 'req', 'Please Enter Features%%features');
 $obj->add_fields($std_equip, 'req', 'Please Enter Standard Equipment%%std_equip');
 $error_tab4 = $obj->validate();
 unset($obj);
 if ($error_tab1 != '') {
     $errorMsges .= $error_tab1;
 }
 if ($error_tab2 != '') {
     $errorMsges .= $error_tab2;
 }
 if ($error_tab3 != '') {
     $errorMsges .= $error_tab3;
 }
 if ($error_tab4 != '') {
     $errorMsges .= $error_tab4;
 }
 if ($error_tab4 == '' && $error_tab3 == '' && $error_tab1 == '' && $error_tab2 == '') {
     $_SESSION['success_msg'] = 'Car has been saved successfully.';
开发者ID:pankajsinghjarial,项目名称:SYLC-NEWSITE,代码行数:31,代码来源:car_edit_code.php

示例3: redirectUrl

            } else {
                redirectUrl(DEFAULT_ADMIN_URL . '/dashboard/index.php');
            }
            exit;
        } else {
            $result = "Invalid username or password";
        }
    } else {
        $result = "Please fill all the required fields.";
    }
    unset($objLogin);
} else {
    if (isset($forgot_submit)) {
        $objValidation = new validation();
        $objValidation->add_fields($email, 'req', 'Please Enter Email Address');
        $error = $objValidation->validate();
        if ($error) {
            $errorForgot = $error;
            $flag = 1;
            unset($objValidation);
        } else {
            $objLogin = new LoginSystem();
            $objCommon = new common();
            $result_forgot = $objCommon->read(TBL_ADMIN, "email='" . $objLogin->clean($email) . "'");
            $row_forgot = $db->fetchNextObject($result_forgot);
            //pr($row_forgot);exit;
            if ($row_forgot->email == $email && isset($row_forgot->email)) {
                $message = '
									<p>Your Login Details are as follows :</p>
									<table width="75%" border="0" cellpadding="2" cellspacing="0">
									<tr>
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:login_code.php

示例4: array

// admin email from which email address email will be sent
$admin_email_from_name = 'System';
//admin name from which email will be sent
$admin_send_subject = 'Contact form alert';
//email subject what the admin will get as contact email alert
$user_send_subject = 'Thanks for contact, your copy';
//email subject what the user will get if the user agreed or select "copy me"
//end options parameter for user
$list = array();
$validation_message = array('error' => false, 'error_field' => array(), 'message' => array());
$rules = array('cbxname' => 'trim|required|alpha_spaces', 'cbxemail' => 'trim|required|email', 'cbxphone' => 'trim|numeric', 'cbxmessage' => 'trim|required|alpha_numeric_spaces');
if ($_POST) {
    require_once __DIR__ . DS . 'class.validation.php';
    $frm_val = new validation();
    foreach ($rules as $post_key => $rule) {
        $frm_val->validate($post_key, $rule);
    }
    $validation_info = $frm_val->validation_info();
    $validation_message['error'] = !$validation_info['validation'];
    foreach ($validation_info['error_list'] as $error_field => $message) {
        $validation_message['error_field'][] = $error_field;
        $validation_message['message'][$error_field] = $message;
    }
    $cbxname = $frm_val->get_value('cbxname');
    //var_dump($cbxname);
    $cbxemail = $frm_val->get_value('cbxemail');
    $cbxphone = $frm_val->get_value('cbxphone');
    ///var_dump($cbxemail);
    $cbxsendme = isset($_POST['cbxsendme']) ? 'on' : '';
    ///var_dump($cbxsendme);
    $cbxmessage = $frm_val->get_value('cbxmessage');
开发者ID:hrishikesh1990,项目名称:alance,代码行数:31,代码来源:contact.php

示例5: validation

$obj = new validation();
if (isset($submit) && $submit != "" && $_SERVER['REQUEST_METHOD'] == 'POST') {
    //customerinfo
    if (isset($custhid) && $custhid == 'custhid') {
        $custerror = '';
        $obj->add_fields($name, 'req', 'Please Enter First Name');
        $obj->add_fields($first_name, 'req', 'Please Enter Last Name');
        $obj->add_fields($address, 'req', 'Please Enter Address');
        $obj->add_fields($city, 'req', 'Please Enter City');
        $obj->add_fields($postcode, 'req', 'Please Enter Postal Code');
        $obj->add_fields($postcode, 'zip', 'Please Enter a Valid Postal Code');
        $obj->add_fields($phone, 'req', 'Please Enter Phone');
        //		$obj->add_fields($phone, 'phone=us', 'Please Enter a Valid Phone');
        $obj->add_fields($email, 'req', 'Please Enter Email');
        $obj->add_fields($email, 'email', 'Please Enter a Valid Email');
        $custerror = $obj->validate();
        if ($custerror) {
            $custerrorMsg = "<font color='#FF0000' family='verdana' size=2>" . $custerror . "</font>";
        } else {
            $dataArr = array('name' => ucfirst($name), 'first_name' => $first_name, 'address' => $address, 'city' => $city, 'postcode' => $postcode, 'phone' => $phone, 'email' => $email);
            $update_Article = $objCommon->update("leads", $dataArr, "id ='{$id}'");
            $use = $objCommon->read("leads", "id ={$id}");
            $usefetch = $db->fetchNextObject($use);
            $dataArrs = array('email' => $email);
            //echo $usefetch->user_id; die;
            if ($usefetch->user_id != '') {
                $uer = $usefetch->user_id;
                $updatesee = $objCommon->update("users", $dataArrs, "id ={$uer}");
            }
            $custerrorMsg = "<font color='#026701' family='verdana' size=2>Successfully Updated</font>";
        }
开发者ID:pankajsinghjarial,项目名称:SYLC,代码行数:31,代码来源:customer_info_code.php

示例6:

$obj->add_fields($username1, 'req', 'Please Enter Username');
$obj->add_fields($username1, 'min=6', 'Username must be 6 characters long');
if ($id == '') {
    $obj->add_fields($password1, 'req', 'Please Enter Password');
    $obj->add_fields($password1, 'min=6', 'Password must be 6 characters long');
    $obj->add_fields($reenterpassword, 'req', 'Please Re-Enter Password');
}
if ($id != '' && $password1 != '') {
    $obj->add_fields($password1, 'req', 'Please Enter Password');
    $obj->add_fields($password1, 'min=6', 'Password must be 6 characters long');
    $obj->add_fields($reenterpassword, 'req', 'Please Re-Enter Password');
}
$obj->add_fields($emailid1, 'req', 'Please Enter Email');
$obj->add_fields($emailid1, 'email', 'Please Enter a Valid Email');
//$obj->add_fields($address, 'req', 'Please Enter Address');
$custlogerror = $obj->validate();
if ($id == '') {
    if ($password1 != $reenterpassword) {
        $custlogerror .= "Password Does not match";
    }
}
if ($id != '' && $password1 != '') {
    if ($password1 != $reenterpassword) {
        $custlogerror .= "Password Does not match";
    }
}
if (isset($id) && $id != '') {
    $loginInfocheck = $objCommon->read('users', "id != {$id} and username = '{$username1}'");
    if (mysql_num_rows($loginInfocheck) > 0) {
        $custlogerror = "Username Already Taken.";
    }
开发者ID:pankajsinghjarial,项目名称:SYLC-NEWSITE,代码行数:31,代码来源:ajax.php


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