web建站教程
  1. 首页
  2. vuejs
  3. js
  4. 好玩
  5. seo教程
  6. 前端知识
  7. 百度echarts
  8. 更多
    php入门
    nodejs
    mockjs
    reactjs
    mysql
    wordpress
    织梦cms
    帝国cms
    git教程
    IT知识
    模板大全
    休息站

帝国cms分类信息如何查询电话号码

321 ℃
     

帝国cms分类信息如何查询电话号码,下面直接看代码:

<?php
/**
sooden
2007-10-2
**/
header("Content-type: text/html;charset=gbk");
/*
构建函数
*/
//读取电话号码文件
function readfiletext($file, $id) {
    $myaddress = '';
    $fp = @file("$file");
    //循环比对
    for ($i = 0; $i < count($fp); $i++) {
        $readfile = explode('||', $fp[$i]);
        $file1 = $readfile['0'];
        $file2 = $readfile['1'];
        $id == $file1 ? $myaddress = $file2: '';
    }
    return $myaddress;
}
//写文件
function writefiletext($file, $string) {
    $string = stripslashes($string);
    $fp = @fopen($file, 'a+');@fwrite($fp, $string);@fclose($fp);
}
//匹配函数
function Cut($FileStr, $StartStr, $EndStr, $Type) {
    if (ereg($StartStr, $FileStr) && ereg($EndStr, $FileStr)) {
        if ($Type == 0) {
            $GetContent = substr($FileStr, 0 – (strlen($FileStr) – (strpos($FileStr, $StartStr) + strlen($StartStr))));
            $GetContent = substr($GetContent, 0, strpos($GetContent, $EndStr));
            return $GetContent;
        } else {
            $GetContent = substr($FileStr, 0 – (strlen($FileStr) – (strpos($FileStr, $StartStr))));
            $GetContent = substr($GetContent, 0, strpos($GetContent, $EndStr) + strlen($EndStr));
            return $GetContent;
        }
    } else {
        return "";
    }
}
/*
函数构建结束
*/
$id = $_GET['id']; //ID
$file = 'phone.txt'; //设定电话文件地址
//如果ID为空退出
if (empty($id)) {
    exit();
} else {
    //查询文件内是否有地址
    $myaddress = readfiletext($file, $id);
    if ($myaddress) {
        $showadd = $myaddress;
    } else {
        //获得号码地址页面
        $show = file_get_contents("http://www.123cha.com/ip/?q=$id"); //手机号码段
        //写入文件
        @$dh = Cut($show, '您的查询:&nbsp;', "n</li><li>", 0);
        if (!$dh) {@$dh = Cut($show, '您的查询:&nbsp;', '&nbsp;</li><li>', 0);
        }
        $dh = trim(ereg_replace("rn", "", $dh));
        $dh = nl2br(preg_replace('/[ ]+/', ' ', $dh));
        $showadd = $dh;
        $dh = $id.'||'.$dh.'||'."rn";
        writefiletext($file, $dh);
    }
} ? ><span>
  <a href="#clos" onclick="ShowTel();" />X关闭
  < /a></span>&nbsp; & nbsp;
< font color=r ed>查询结果
  < /font>
    <div id=cresult>
      <ul>
        <?php if ($showadd) { print_r(str_replace( "查询太频繁,暂时禁用", "无", "$showadd")); / / $showadd); } else {     echo "<li>服务器忙,请稍后再试……"; } ?></li></ul>
    </div>

php开发中如何将blob转成file

CMS网站被挂黑链应该如何解决?(如何防止黑链)

dede Fatal error: Call to a member function read() on a non-

详解织梦DedeCms的安全问题优化解决办法(安全设置

帝国CMS-前台定时执行刷新任务插件下载

标签: CMS网站, file格式, fp, 查询, 电话号码

上面是“帝国cms分类信息如何查询电话号码”的全面内容,想了解更多关于 帝国cms 内容,请继续关注web建站教程。

当前网址:https://ipkd.cn/webs_1356.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

当前位置: 网站首页 > 帝国cms
本文共计2012个字,预计阅读时长14分钟
生活小工具,收录了80多款小工具
上一篇: 阿里巴巴普惠体3.0字体已经更新(最强中文字体)
下一篇: 跨平台划词翻译、截图翻译工具——Pot划词翻译
x 打工人ai神器