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

PHP is_valid函数代码示例

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

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



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

示例1: contact_plugin

function contact_plugin()
{
    if (isset($_POST['submit'])) {
        $username = $_POST['username'];
        $subject = $_POST['subject'];
        $message = $_POST['content'];
        echo "<br/>";
        echo "<br/>";
        echo "<br/>";
        echo "<br/>";
        echo $username;
        if (is_valid($subject, $message) == false) {
            echo "</br></br></br>";
            echo $subject . "</br>";
            echo $message;
            $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
            mail("[email protected]", $subject, $message, $headers);
        }
    }
    echo '<div class="contain">';
    echo '<form action="" method="post">';
    echo '<div class="form-group">';
    echo '<label>Enter Your name</label>';
    echo '<input  name="username" class="form-control" id="un" required ">';
    echo '<label>Topic</label>';
    echo '<input  name="subject" class="form-control" id="un" required ">';
    echo '<label>Message</label>';
    echo '<textarea class="form-control" rows="5" name="content" id="comment"></textarea>';
    echo '<div id="button1">';
    echo '<button name="submit" type="submit" class="btn btn-primary btn-block">Submit</button>';
    echo '</div>';
    echo '</div>';
    echo '</form>';
    echo '</div>';
}
开发者ID:asmith41,项目名称:wp_btf,代码行数:35,代码来源:contact.php


示例2: next_password

function next_password($codes)
{
    $codes = increase($codes);
    while (!is_valid($codes)) {
        $codes = increase($codes);
    }
    return $codes;
}
开发者ID:radugroza,项目名称:adventofcode,代码行数:8,代码来源:11.php


示例3: get

 public function get($slug)
 {
     if (is_valid($slug)) {
         $this->ttpl->set('title', 'Hello, world');
         $this->ttpl->set('content', 'Load an article that matches the slug: ' . $slug);
     } else {
         $this->not_found();
     }
 }
开发者ID:rossbeale,项目名称:ToroPHP-and-ToroTemplate,代码行数:9,代码来源:index.php


示例4: upload

 public function upload($file, $options = array())
 {
     $options['return_error'] = false;
     $ret = Uploader::upload($file, $options);
     $preloaded = new PreloadedFile(Cloudinary::signedPreloadedImage($ret));
     if ($this->verifyUpload && !$preloaded . is_valid()) {
         throw new \Exception("Error! Couldn't verify cloudinary response!");
     }
     $this->identifier = $preloaded->extendedIdentifier();
 }
开发者ID:engineor,项目名称:cloudinary_php,代码行数:10,代码来源:CloudinaryField.php


示例5: get_wet

function get_wet()
{
    $wet_url = 'http://121.42.31.195:9071/WIFPa/ResourceData.xml/0001000054f08cfa?ResourceID=4';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $wet_url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    $wet_data = curl_exec($ch);
    curl_close($ch);
    $wet_reg = '/<resvalue>(.*?)<\\/resvalue>/';
    $wet_ret = is_valid($wet_data, $wet_reg);
    $tag_start_len = strlen('<resvalue>');
    $tag_end_len = strlen('<\\/resvalue>');
    $gross_len = strlen($wet_ret);
    $wet_len = $gross_len - $tag_start_len - $tag_end_len;
    $wet_ret = substr($wet_ret, $tag_start_len, $wet_len + 1);
    return $wet_ret;
}
开发者ID:EmuxEvans,项目名称:wot_gateway,代码行数:18,代码来源:get_all.php


示例6: show_cast

/**
 * Display the series cast
 */
function show_cast()
{
    global $apikey, $w, $id;
    $url = "http://api.trakt.tv/show/summary.json/{$apikey}/{$id}/extended";
    $show = $w->request($url);
    $show = json_decode($show);
    if (is_valid($show)) {
        $w->result('cast', '', 'Back ...', '', 'icons/back.png', 'no', 'id:' . $id . ':summary');
        foreach ($show->people->actors as $actor) {
            $w->result('cast', '', $actor->character, $actor->name, 'icons/actor.png', 'no');
        }
    }
}
开发者ID:obstschale,项目名称:AlfredWorkflow.com,代码行数:16,代码来源:traktforalfred.php


示例7: header

                    case "getIndic":
                        $rt->getIndic();
                        break;
                    case "getData":
                        if (isset($_GET['idgraphe'])) {
                            $rt->getData($_GET['idgraphe']);
                        }
                        break;
                    case "getBoilerMode":
                        if (isset($_GET['way'])) {
                            $rt->getBoilerMode($_GET['way']);
                        }
                        break;
                    case "setBoilerMode":
                        if (isset($_GET['mode']) && isset($_GET['way'])) {
                            $rt->setBoilerMode($_GET['mode']);
                            break;
                        }
                }
                break;
        }
    }
} else {
    if (!is_ajax()) {
        echo '<pre>xmlhttprequest needed ! </pre>';
    }
    if (!is_valid()) {
        header("Content-type: text/json; charset=utf-8");
        echo '{"response": false,"apiToken": "invalid"}';
    }
}
开发者ID:bertrandgorge,项目名称:okovision,代码行数:31,代码来源:api.php


示例8: stripslashes

  <TR>
            <TD width="10" vAlign=top</TD>
          <TD width="740" vAlign=top colspan="2">

      &nbsp;&nbsp;<IMG SRC="images/menu/textmenu_member.gif" BORDER="0">
				<TABLE width="740" align=center cellSpacing=0 cellPadding=0 border=0>
				<TR>
					<TD height="1" class="dotline" ></TD>
				</TR>
      <TR><td>
<?php 
$user_login = stripslashes($_POST['user_login']);
$user_login = mysql_real_escape_string($_POST['user_login']);
$pwd_login = stripslashes($_POST['pwd_login']);
$pwd_login = mysql_real_escape_string($_POST['pwd_login']);
if (is_valid($user_login) == true && is_valid($pwd_login) == true) {
    $Username = preg_replace('/"/i', '\\"', $user_login);
    $Password = preg_replace("/'/i", "\\'", $pwd_login);
    anti_injection($Username, $Password, $IPADDRESS);
    //ÃкºÊÁÒªÔ¡àÊÃÔÁ maxsite 1.10 ¾Ñ²¹Òâ´Â www.narongrit.net
    if (USE_CAPCHA) {
        if ($_SESSION['security_code'] != $_POST['security_code'] or empty($_POST['security_code'])) {
            echo "<script language='javascript'>";
            echo "alert('" . _JAVA_CAPTCHA_NOACC . "')";
            echo "</script>";
            echo "<script language='javascript'>javascript:history.go(-1)</script>";
            //		echo "		if(".$_SESSION['security_code']." != ".$_POST['security_code']." OR empty(".$_POST['security_code'].")) {";
            exit;
        }
    }
    if (isset($Username) and isset($Password)) {
开发者ID:robocon,项目名称:iopr,代码行数:31,代码来源:login_check.php


示例9: mysql_free_result

if ($row && $row->user_id == $_SESSION['user_id']) {
    $ok = true;
}
if (isset($_SESSION['source_browser'])) {
    $ok = true;
}
$view_reinfo = "";
if ($ok == true) {
    if ($row->user_id != $_SESSION['user_id']) {
        $view_mail_link = "<a href='mail.php?to_user={$row->user_id}&title={$MSG_SUBMIT} {$id}'>Mail the auther</a>";
    }
    mysql_free_result($result);
    $sql = "SELECT `error` FROM `runtimeinfo` WHERE `solution_id`='" . $id . "'";
    $result = mysql_query($sql);
    $row = mysql_fetch_object($result);
    if ($row && ($OJ_SHOW_DIFF || is_valid($row->error))) {
        $view_reinfo = htmlspecialchars(str_replace("\n\r", "\n", $row->error));
    }
    mysql_free_result($result);
} else {
    mysql_free_result($result);
    $view_errors = "I am sorry, You could not view this message!";
    require "template/" . $OJ_TEMPLATE . "/error.php";
    exit(0);
}
/////////////////////////Template
require "template/" . $OJ_TEMPLATE . "/reinfo.php";
/////////////////////////Common foot
if (file_exists('./include/cache_end.php')) {
    require_once './include/cache_end.php';
}
开发者ID:RX78NY1,项目名称:hustoj,代码行数:31,代码来源:reinfo.php


示例10: sendHipchatMessage

<?php

require __DIR__ . '/vendor/autoload.php';
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
$request = Request::createFromGlobals();
if (is_valid($request)) {
    sendHipchatMessage($request);
}
/**
 * Verification request + calcul signature
 */
function is_valid($request)
{
    $payload = $request->getContent();
    if (empty($payload)) {
        returnResponse('empty payload', 400);
        return false;
    }
    //Bignou calcul signature Gihub
    if (!isGithubSignatureValid($request)) {
        returnResponse('invalid github signature', 400);
        return false;
    }
    //verif valid payload
    if (null === json_decode($payload)) {
        returnResponse('invalid json body', 400);
        return false;
    }
开发者ID:rseliberty,项目名称:github-hipchat,代码行数:31,代码来源:payload.php


示例11: mx_mnfanmed

function mx_mnfanmed($page, $option, $action)
{
    global $mxuser;
    mx_showhtmlpage('fanmed');
    $subs = $mxuser->getsub();
    // TODO: search active subs only
    //error_log('subs:'.print_r($subs,true));
    $artists = array();
    foreach ($subs as $sub) {
        if (is_valid($sub)) {
            $artists[] = $sub->artistid;
        }
    }
    echo mx_showmediastr($artists, 'fanmed');
}
开发者ID:nsystem1,项目名称:OS-MusXpand,代码行数:15,代码来源:mx_media.php


示例12: elseif

    // check all chars are valid
    if (!preg_match("/^[-+*\\/.\\d]+\$/", $expr)) {
        return false;
    } elseif (preg_match("/^[+*\\/.]{2,}\$/", $expr)) {
        return false;
    } elseif (preg_match("/^[-]{3,}\$/", $expr)) {
        return false;
    } elseif (preg_match("/^[+*\\/.]/", $expr)) {
        return false;
    } elseif (preg_match("/[-+*\\/.]\$/", $expr)) {
        return false;
    }
    return true;
}
$expr = trim($_GET["expr"]);
if (is_valid($expr)) {
    $expr = str_replace("--", "+", $expr);
    if (preg_match("/\\/[0]/", $expr)) {
        // does NOT handle cases such as 1/0.5
        echo "Division by zero error!";
    } else {
        $invalid = eval("\$ans={$expr};");
        if ($invalid) {
            echo "Invalid expression!";
        } else {
            echo $expr . " = " . $ans;
        }
    }
} else {
    echo "Invalid expression!";
}
开发者ID:danielgeng,项目名称:cs143,代码行数:31,代码来源:calculator.php


示例13: get_nameid

}
function get_nameid($xml)
{
    $xpath = new DOMXPath($xml);
    $xpath->registerNamespace("samlp", "urn:oasis:names:tc:SAML:2.0:protocol");
    $xpath->registerNamespace("saml", "urn:oasis:names:tc:SAML:2.0:assertion");
    //$query = "/samlp:Response/saml:Assertion/saml:Subject/saml:NameID";
    $query = "/samlp:Response/saml:Assertion/saml:AttributeStatement/saml:Attribute";
    $entries = $xpath->query($query);
    return $entries->item(0)->nodeValue;
}
function genToken()
{
    return mt_rand() . mt_rand() . mt_rand() . mt_rand() . mt_rand();
}
if (is_valid($document, $x509certificate)) {
    //echo htmlentities($documentStr);
    $authedUser = get_nameid($document);
    $desiredUser = $_COOKIE['userId'];
    if ($authedUser != $desiredUser) {
        echo "Sorry, you want to log in to '{$desiredUser}' but it looks like you are '{$authedUser}'. Please go away.";
        die;
    } else {
        $token = genToken();
        $categories = json_encode(explode(',', $_COOKIE['scope']));
        $redis->set('token:' . $_COOKIE['userId'] . ':' . $token, $categories);
        //echo 'redis->set(token:'.$_COOKIE['userId'].':'.$token.', '.$categories;
        //echo 'Location: '.$_COOKIE['redirectUri'].'#access_token='.urlencode($token);
        header('Location: ' . $_COOKIE['redirectUri'] . '#access_token=' . urlencode($token));
    }
} else {
开发者ID:nethad,项目名称:experiments,代码行数:31,代码来源:saml2.php


示例14: mysqli_free_result

if ($row && $row->user_id == $_SESSION['user_id']) {
    $ok = true;
}
if (isset($_SESSION['source_browser'])) {
    $ok = true;
}
$view_reinfo = "";
if ($ok == true) {
    if ($row->user_id != $_SESSION['user_id']) {
        $view_mail_link = "<a href='mail.php?to_user={$row->user_id}&title={$MSG_SUBMIT} {$id}'>Mail the auther</a>";
    }
    mysqli_free_result($result);
    $sql = "SELECT `error` FROM `runtimeinfo` WHERE `solution_id`='" . $id . "'";
    $result = mysqli_query($mysqli, $sql);
    $row = mysqli_fetch_object($result);
    if ($row && ($OJ_SHOW_DIFF || $OJ_TEST_RUN || is_valid($row->error))) {
        $view_reinfo = htmlentities(str_replace("\n\r", "\n", $row->error), ENT_QUOTES, "UTF-8");
    }
    mysqli_free_result($result);
} else {
    mysqli_free_result($result);
    $view_errors = "I am sorry, You could not view this message!";
    require "template/" . $OJ_TEMPLATE . "/error.php";
    exit(0);
}
/////////////////////////Template
require "template/" . $OJ_TEMPLATE . "/reinfo.php";
/////////////////////////Common foot
if (file_exists('./include/cache_end.php')) {
    require_once './include/cache_end.php';
}
开发者ID:RX78NY1,项目名称:hustoj,代码行数:31,代码来源:reinfo.php


示例15: die

    if (mydb::cxn()->error != '') {
        die("Retrieving valid YEARs failed: " . mydb::cxn()->error . "<br>\n" . $query);
    }
    while ($row = $result->fetch_assoc()) {
        if ($row['year'] == $year) {
            return 1;
        }
    }
    return 0;
    //Year is NOT valid or else function would have returned 1 by now
}
//************** MAIN **************************************
if ($_GET['year'] == "current") {
    $_GET['year'] = date('Y');
}
if (is_valid($_GET['year'])) {
    $year = $_GET['year'];
} else {
    $year = 0;
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Roster :: Siskiyou Rappel Crew</title>

<?php 
开发者ID:evanhsu,项目名称:siskiyourappellers,代码行数:31,代码来源:roster.php


示例16: is_valid

$id = "{${'ADR' . $invt_num}}_1";
$G1V = is_valid($id, $data);
settype($G1V, 'float');
$data = exec("cat /run/shm/metern{${'ADR' . $invt_num}}.txt | egrep \"^{${'ADR' . $invt_num}}_2\\(\" | egrep \"\\*A\\)\$\"");
$id = "{${'ADR' . $invt_num}}_2";
$G1A = is_valid($id, $data);
settype($G1A, 'float');
$data = exec("cat /run/shm/metern{${'ADR' . $invt_num}}.txt | egrep \"^{${'ADR' . $invt_num}}\\(\" | egrep \"\\*W\\)\$\"");
$id = "{${'ADR' . $invt_num}}";
$G1P = is_valid($id, $data);
settype($G1P, 'float');
$data = exec("cat /run/shm/metern{${'ADR' . $invt_num}}.txt | egrep \"^{${'ADR' . $invt_num}}_3\\(\" | egrep \"\\*Hz\\)\$\"");
$id = "{${'ADR' . $invt_num}}_3";
$FRQ = is_valid($id, $data);
settype($FRQ, 'float');
$EFF = (double) 0.0;
$INVT = null;
$BOOT = null;
$data = exec("cat /run/shm/metern{${'ADR' . $invt_num}}.txt | egrep \"^{${'ADR' . $invt_num}}\\(\" | egrep \"\\*Wh\\)\$\"");
$id = "{${'ADR' . $invt_num}}";
$KWHT = is_valid($id, $data);
settype($KWHT, 'float');
$KWHT = $KWHT / 1000;
if ($KWHT != 0) {
    $RET = 'OK';
} else {
    $RET = 'NOK';
}
if ($DEBUG != 0) {
    echo "G1V = {$G1V}, G1A = {$G1A}, G1P = {$G1P}, FRQ = {$FRQ}, EFF = {$EFF}, KWHT = {$KWHT}";
}
开发者ID:neosilviu,项目名称:SDM120C,代码行数:31,代码来源:sdm120c-pool.php


示例17: pack

//AQUISIZIONE DATI
$mem_id = $_GET['MEM_ID'];
//dell'utente da modificare
$mem_hash = pack('H*', $mem_id);
list($user_hash, $user_id) = get_my_info($SNAME);
if (!$_SESSION[$SNAME]['sess_auth']) {
    $url = "login.php";
    echo "<tr><td><center>" . $lang['sign_login'] . "<br>";
    echo "" . $lang['reply_loginred'] . "</center></td></tr><script language=\"javascript\" type='text\\javasript'>setTimeout('delayer()', 1500);\nfunction delayer(){ window.location='{$url}';}</script>";
    include "end.php";
    exit(0);
}
//POSTBACK PAGE
if ($_POST['MEM_ID']) {
    $is_post_back = 1;
    if ($user_id != $_POST['MEM_ID'] && !is_valid($_POST['privkey'])) {
        echo '<tr><td>
		<table cellspacing="0" width="100%">
		<tr>
		<td valign="top" class="nopad" width="24%">' . show_menu() . '</td>
		<td class="nopad" width="1%"><!-- --></td>
		<!-- Start main CP area -->
		<td valign="top" class="nopad" width="75%">
			<div id="ucpcontent">
			<div class="maintitle">' . $lang['optsign_welcome'] . '</div>' . show_private_form($_POST) . '</div></td></tr></table>';
    } else {
        if (!$core) {
            $core = new CoreSock();
        }
        $IDENTIFICATORE = md5($_SESSION[$SNAME]['sess_password'] . $_SESSION[$SNAME]['sess_nick']);
        // = identificatore dell'utente nella tabella localmember. easadecimale
开发者ID:BackupTheBerlios,项目名称:keyforum-svn,代码行数:31,代码来源:options_sign.php


示例18: unset

     $shTempPathArray = $path_array;
     $shSaveRequestURIBackup = $shPageInfo->shSaveRequestURI;
     if (!empty($shLastBit)) {
         // if URl does not end with a /
         $shTempPathArray[] = '';
         // add one
         $shPageInfo->shSaveRequestURI .= '/';
     } else {
         unset($shTempPathArray[count($shTempPathArray) - 1]);
         // if it ends with a /, remove it
         rtrim($shPageInfo->shSaveRequestURI, '/');
     }
     $shQueryString = $sef_ext->revert($shTempPathArray, $pos);
     // warning : revert may do a 301 to same url with correct case !
     $shPageInfo->shSaveRequestURI = $shSaveRequestURIBackup;
     if (is_valid($shQueryString)) {
         //let's redirect to this new URL
         $dest = str_replace($GLOBALS['shConfigLiveSite'] . $sefConfig->shRewriteStrings[$sefConfig->shRewriteMode], '', $shPageInfo->URI->url);
         $dest = JString::trim(str_replace($GLOBALS['shConfigLiveSite'], '', $dest), '/');
         _log('Redirecting to same with trailing slash added');
         shRedirect($GLOBALS['shConfigLiveSite'] . $sefConfig->shRewriteStrings[$sefConfig->shRewriteMode] . $dest . (empty($shLastBit) ? '' : '/'));
     }
 }
 // V 1.3.1 : check for aliases
 $path = $sefConfig->shEncodeUrl ? shUrlEncode($path) : $path;
 shCheckCustomRedirects($path, $shPageInfo);
 // check Joomla 1.5 sef redirect to sh404sef redirect
 if (empty($shPageInfo->autoRedirectsDisabled) && $sefConfig->shRedirectJoomlaSefToSef) {
     // get current URI and router
     $jUri = clone $uri;
     $shRouter =& $mainframe->getRouter();
开发者ID:justinlyon,项目名称:scc,代码行数:31,代码来源:sh404sef.inc.php


示例19: security_test_arg

function security_test_arg()
{
    // now, all arguments must be in validargs
    foreach ($_GET as $value) {
        if (!is_valid($value)) {
            hacker_gaught();
        }
    }
    foreach ($_POST as $value) {
        if (!is_valid($value)) {
            hacker_gaught();
        }
    }
}
开发者ID:rwaldron,项目名称:git-php,代码行数:14,代码来源:security.php


示例20: array

    <?php 
/* Define global field array for use in custom error messages */
$requiredField = array('amount' => 'amount', 'unit' => 'unit');
/* Define validation rule messages */
$errorMessage = array('no_amount' => 'You did not enter an amount', 'no_unit' => 'You did not enter a unit to convert to', 'num_above_zero' => 'The entered amount must be numeric and greater than zero');
/* Define error array */
$errors = array();
/* If the convert button was pressed */
if (isset($_POST['convert'])) {
    /* Check if an amount has been entered */
    if (!is_valid(sanitize_input($_POST[$requiredField['amount']]))) {
        array_push($errors, [$requiredField['amount'] => $errorMessage['no_amount']]);
    }
    /* If an amount has been entered and is valid, check if numeric and greater than zero */
    if (is_valid(sanitize_input($_POST[$requiredField['amount']])) && !is_num_above_zero($_POST[$requiredField['amount']])) {
        array_push($errors, [$requiredField['amount'] => $errorMessage['num_above_zero']]);
    }
    /* Check if a unit has been selected */
    if ($_POST[$requiredField['unit']] == 'default') {
        array_push($errors, [$requiredField['unit'] => $errorMessage['no_unit']]);
    }
    /* If there are no errors, convert! */
    if (!has_items($errors)) {
        /* Send the submitted values to the convert function */
        $convertedValue = ConvertLiquid($_POST[$requiredField['amount']], $_POST[$requiredField['unit']]);
    }
} else {
    if (isset($_POST['reset'])) {
        unset($errors);
    }
开发者ID:egnsh93,项目名称:CST8257,代码行数:30,代码来源:converter.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP is_valid_email函数代码示例发布时间:2022-05-15
下一篇:
PHP is_uuid函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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