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

PHP filter_ip函数代码示例

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

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



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

示例1: substr

if ($settingInfo['rewrite'] == 0) {
    $gourl = "index.php?load={$load}";
}
if ($settingInfo['rewrite'] == 1) {
    $gourl = "rewrite.php/{$load}";
}
if ($settingInfo['rewrite'] == 2) {
    $gourl = "{$load}";
}
if ($settingInfo['rewrite'] == 1) {
    $base_rewrite = "http://" . $_SERVER['HTTP_HOST'] . substr($PHP_SELF, 0, strpos($PHP_SELF, "f2blog_ajax.php"));
} else {
    $base_rewrite = "";
}
//过滤IP
$allow_reply = filter_ip(getip());
$openwin_width = "560";
$openwin_height = "450";
if ($page < 1) {
    $page = 1;
}
$start_record = ($page - 1) * $per_page;
$sql = "select distinct a.*,b.id as member_id,b.nickname,b.isHiddenEmail,b.email as member_email,b.homePage as member_homepage from " . $DBPrefix . "guestbook as a left join " . $DBPrefix . "members as b on a.author=b.username where parent='0' order by postTime {$settingInfo['gbookOrder']}";
$nums_sql = "select count(id) as numRows from " . $DBPrefix . "guestbook where parent='0'";
$total_num = getNumRows($nums_sql);
$query_sql = $sql . " Limit {$start_record},{$per_page}";
$query_result = $DMC->query($query_sql);
$arr_parent = $DMC->fetchQueryAll($query_result);
?>
	<div class="pageContent" style="OVERFLOW: hidden; LINE-HEIGHT: 140%; HEIGHT: 18px; TEXT-ALIGN: right">
	  <div class="page" style="float:left"><span id="load_ajax_msg"></span>
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:guestbook_page_ajax.inc.php


示例2: tb_extra

<br/><a href="index.php"><?php 
    echo $strErrorBack;
    ?>
</a></div>
	  </div>
	</div>
  </div><br/><br/>

<?php 
} else {
    $arr_array = $DMF->fetchQueryAll($result);
    $fa = $arr_array[0];
    $strFeadLogs = $strFeadAll . $fa['name'] . $strLogss;
    $strViewLogs = $strView . $fa['name'] . $strLogss;
    $extra = tb_extra($id, $fa['postTime']);
    if (!filter_ip(getip()) or $fa['isTrackback'] == 0) {
        //为禁止IP时,不给看引用地址
        $tb_url = "";
    } else {
        $tb_url = $settingInfo['blogUrl'] . "trackback.php?tbID={$id}&extra={$extra}";
    }
    $postTime = $fa['postTime'];
    $searchSql = searchSQL($job, $seekname);
    $prevsql = "SELECT id,logTitle FROM " . $DBPrefix . "logs WHERE postTime < '" . $postTime . "' and saveType=1 {$searchSql} ORDER BY postTime DESC LIMIT 1";
    $prevLog = $DMF->fetchArray($DMF->query($prevsql));
    $previd = $prevLog['id'];
    $prevtitle = "{$strPrevLog}{$strHomeLog}: " . $prevLog['logTitle'];
    $nextsql = "SELECT id,logTitle FROM " . $DBPrefix . "logs WHERE postTime > '" . $postTime . "' and saveType=1 {$searchSql} ORDER BY postTime ASC LIMIT 1";
    $nextLog = $DMF->fetchArray($DMF->query($nextsql));
    $nextid = $nextLog['id'];
    $nexttitle = "{$strNextLog}{$strHomeLog}: " . $nextLog['logTitle'];
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:readlogs.inc.php


示例3: header

<?php

include_once "include/function.php";
//过滤IP
if (!filter_ip(getip())) {
    header("HTTP/1.0 404 Not Found");
    exit;
}
$postid = $_REQUEST['postid'];
$id = $_REQUEST['id'];
//判断是否正常进入该页
if ($_GET['load'] == "read" && $postid != "" && $id != "") {
    //评论
    $Title = "{$strCommentsReplyTitle}";
    $posturl = "{$PHP_SELF}?load=" . $_GET['load'] . "&page=" . $_GET['page'];
} else {
    if ($_GET['load'] == "guestbook" && $postid != "") {
        //留言
        $Title = "{$strGuestBookReplyTitle}";
        $posturl = "{$PHP_SELF}?load=" . $_GET['load'] . "&page=" . $_GET['page'];
    } else {
        //非法进入
        header("HTTP/1.0 404 Not Found");
        exit;
    }
}
//读取验证码的图片
$validate_image = "include/image_firefox.inc.php";
//保存留言内容
if ($_GET['action'] == "save") {
    $check_info = true;
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:reply.php


示例4: substr

    echo $strErrorNoExistsLog;
    ?>
<br /><a href="index.php"><?php 
    echo $strErrorBack;
    ?>
</a></div>
	  </div>
	</div>
  </div><br /><br />
<?php 
} else {
    $fa = $arr_array;
    $strFeadLogs = $strFeadAll . $fa['name'] . $strLogss;
    $strViewLogs = $strView . $fa['name'] . $strLogss;
    //使用Ajax技术
    if (!filter_ip(getip()) or $fa['isTrackback'] == 0 or $settingInfo['allowTrackback'] == 0) {
        //为禁止IP时,不给看引用地址
        $tb_allow = "";
    } else {
        if (strpos(";{$settingInfo['ajaxstatus']};", "T") > 0) {
            $tb_allow = "{$strTrackbackSession}";
        } else {
            $tb_allow = "NoAjax";
            $extra = substr(md5($id . $fa['postTime']), 0, 6);
            $tb_url = $settingInfo['blogUrl'] . "trackback.php?tbID={$id}&amp;extra={$extra}";
        }
    }
    $postTime = $fa['postTime'];
    //读取上下分页
    if ($settingInfo['readpagebar'] == 1) {
        include "cache/cache_logsTitle.php";
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:read.inc.php


示例5: die

<?php

if (!defined('IN_F2BLOG')) {
    die('Access Denied.');
}
$logId = empty($_GET['logId']) ? "" : $_GET['logId'];
$isTrackback = getFieldValue($DBPrefix . "logs", "id='{$logId}'", "isTrackback");
if (!filter_ip(getip()) or $isTrackback == 0) {
    //为禁止IP时,不给看引用地址
    echo $strTrackbackSessionError;
} else {
    //取得随机数
    $tb_extra = tb_extra(10);
    $tbDate = time();
    //写入数据库
    $sql = "insert into " . $DBPrefix . "tbsession(extra,tbDate,logId) values('{$tb_extra}','{$tbDate}','{$logId}')";
    $DMC->query($sql);
    //返回内容
    $home_url = "http://" . $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], "f2blog_ajax.php"));
    echo $home_url . "trackback.php?tbID={$logId}&extra={$tb_extra}";
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:21,代码来源:trackback_session_ajax.inc.php


示例6: tb_xml_error

$excerpt = $_REQUEST['excerpt'];
$url = $_REQUEST['url'];
$blog_name = $_REQUEST['blog_name'];
if ($url == "") {
    tb_xml_error("Invalid URL.");
}
if ($excerpt == "") {
    tb_xml_error("We require all Trackbacks to provide an excerption.");
} else {
    if (strlen($excerpt) > 100) {
        $excerpt = substr($excerpt, 100) . " ...";
    }
    $excerpt = encode($excerpt);
}
//检查过滤
if (!filter_ip($userdetail['ip'])) {
    tb_xml_error("Your IP address is banned from sending trackbacks.");
}
if (replace_filter($excerpt) || replace_filter($title) || replace_filter($blog_name)) {
    tb_xml_error("The trackback content contains some words that are not welcomed on our site. You may edit your post and send it again. Sorry for the inconvenience.");
}
$trytb = $DMF->numRows($DMF->query("SELECT * FROM " . $DBPrefix . "trackbacks WHERE ip='" . getip() . "' AND postTime+30>='" . time() . "'"));
if ($trytb > 0) {
    tb_xml_error("Error.");
}
$spam = $settingInfo['isTbApp'];
// 1为开启审核
if ($spam == 0 or strpos($url, ";" . $settingInfo['ttSiteList']) >= 1) {
    $isApp = 1;
} else {
    $isApp = 0;
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:trackback.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP filter_is_enabled函数代码示例发布时间:2022-05-15
下一篇:
PHP filter_input_array函数代码示例发布时间: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