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


PHP HtmlReplace函数代码示例

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


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

示例1: savegbform

function savegbform()
{
    global $db;
    $title = Html2Text($_POST["title"]);
    $content = HtmlReplace($_POST["content"]);
    $fileurl = HtmlReplace($_POST["fileurl"]);
    $replyid = intval($_POST["replyid"]);
    if (empty($title) || empty($content)) {
        header("location:./");
        exit;
    } else {
        $array = array('title' => $title, 'content' => $content, 'fileurl' => $fileurl, 'replyid' => $replyid, 'addtime' => time(), 'ip' => ip());
        $db->insert("ve123_guestbook", $array);
        header("location:./");
    }
}
开发者ID:tanny2015,项目名称:DataStructure,代码行数:16,代码来源:index.php

示例2: savegbform

function savegbform()
{
    global $db, $http_referer;
    $title = Html2Text($_POST["title"]);
    $content = HtmlReplace($_POST["content"]);
    $fileurl = HtmlReplace($_POST["fileurl"]);
    $replyid = intval($_POST["replyid"]);
    if (empty($title) || empty($content)) {
        header("location:" . $http_referer . "");
        exit;
    } else {
        $array = array('title' => $title, 'content' => $content, 'fileurl' => $fileurl, 'replyid' => $replyid, 'addtime' => time(), 'ip' => ip());
        $db->insert("kuaso_guestbook", $array);
        $db->query("update kuaso_guestbook set reply_time='" . time() . "' where gid='" . $replyid . "'");
        header("location:" . $http_referer . "");
    }
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:17,代码来源:index.php

示例3: checklogin

function checklogin()
{
    global $db;
    $adminname = htmlspecialchars($_POST['adminname']);
    $password = htmlspecialchars($_POST['password']);
    $imagecode = trim(HtmlReplace($_POST['entered_imagecode']));
    if ($_SESSION['dd_ckstr'] != $imagecode) {
        jsalert('验证码错误!', 'login.php');
        break;
    }
    $result = $db->query("select * from ve123_admin where adminname='{$adminname}' and password='{$password}'");
    $num = $db->num_rows($result);
    if ($num > 0) {
        $rs = $db->fetch_array($result);
        $array = array('lastloginip' => $rs['loginip'], 'loginip' => ip(), 'lastlogintime' => $rs['logintime'], 'logintime' => date('Y-y-d H:i:s'));
        $db->update('ve123_admin', $array, "admin_id={$rs['admin_id']}");
        setcookie('adminname', $adminname);
        header('location:index.php');
    } else {
        jsalert('用户名或密码错误!', 'login.php');
    }
}
开发者ID:tanny2015,项目名称:DataStructure,代码行数:22,代码来源:login.php

示例4: MakeField

 function MakeField($fname, $fvalue, $addvalue = '')
 {
     if ($fvalue == '') {
         $fvalue = $this->ChannelFields[$fname]['default'];
     }
     //处理各种数据类型
     $ftype = $this->ChannelFields[$fname]['type'];
     if ($ftype == 'text') {
         $fvalue = HtmlReplace($fvalue);
     } else {
         if ($ftype == 'textdata') {
             if (!is_file($GLOBALS['cfg_basedir'] . $fvalue)) {
                 return '';
             }
             $fp = fopen($GLOBALS['cfg_basedir'] . $fvalue, 'r');
             $fvalue = '';
             while (!feof($fp)) {
                 $fvalue .= fgets($fp, 1024);
             }
             fclose($fp);
         } else {
             if ($ftype == 'addon') {
                 $foldvalue = $fvalue;
                 $tmptext = GetSysTemplets("channel_addon.htm");
                 $fvalue = str_replace('~link~', $foldvalue, $tmptext);
                 $fvalue = str_replace('~phpurl~', $GLOBALS['cfg_phpurl'], $fvalue);
             } else {
                 if (file_exists(DEDEINC . '/taglib/channel/' . $ftype . '.lib.php')) {
                     include_once DEDEINC . '/taglib/channel/' . $ftype . '.lib.php';
                     $func = 'ch_' . $ftype;
                     $fvalue = $func($fvalue, $addvalue, $this, $fname);
                 }
             }
         }
     }
     return $fvalue;
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:37,代码来源:channelunit.class.php

示例5: set_time_limit

set_time_limit(0);
require "global.php";
require_once PATH . "include/spider/spider_class.php";
$spider = new spider();
headhtml();
?>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="tablebg">
  <tr>
    <td><form id="form1" name="form1" method="post" action="?action=start">
      <input type="submit" name="Submit" value="开始一键找站" />
        </form>
    </td>
  </tr>
</table>
<?php 
$action = HtmlReplace(trim($_GET["action"]));
switch ($action) {
    case "start":
        start();
        break;
}
function start()
{
    global $spider;
    echo "正在处理中...<br>";
    print str_repeat(" ", 4096);
    ob_flush();
    flush();
    sleep(1);
    $url = "http://www.hao123.com/";
    $spider->url($url);
开发者ID:tanny2015,项目名称:DataStructure,代码行数:31,代码来源:find_sites.php

示例6: ResetVdValue

         ResetVdValue();
         ShowMsg('验证码错误!', '-1');
         exit;
     }
     $uidnum = intval($uidnum);
     if (empty($uidnum)) {
         ShowMsg('参数错误!', '-1');
         exit;
     }
     if (strlen($msg) < 6) {
         ShowMsg('你的留言内容太短!', '-1');
         exit;
     }
     $uname = HtmlReplace($uname, 1);
     $msg = cn_substrR(HtmlReplace($msg), 2048);
     $title = cn_substrR(HtmlReplace($title), 255);
     if ($cfg_ml->M_UserName != '' && $cfg_ml->M_ID != $uidnum) {
         $gid = $cfg_ml->M_UserName;
     } else {
         $gid = '';
     }
     $inquery = "INSERT INTO `#@__member_guestbook`(mid,gid,title,msg,uname,ip,dtime)\n   VALUES ('{$uidnum}','{$gid}','{$title}','{$msg}','{$uname}','" . GetIP() . "'," . time() . "); ";
     $dsql->ExecuteNoneQuery($inquery);
     ShowMsg('成功提交你的留言!', "index.php?uid={$uid}&action=guestbook");
     exit;
 } else {
     if ($action == 'guestbookdel') {
         CheckRank(0, 0);
         if ($cfg_ml->M_LoginID != $uid) {
             ShowMsg('这条留言不是给你的,你不能删除!', -1);
             exit;
开发者ID:wshudong,项目名称:hbypsy,代码行数:31,代码来源:space_action.php

示例7: GetFieldValueA

                     if (!isset(${$vs[0]})) {
                         ${$vs[0]} = '';
                     }
                     ${$vs[0]} = GetFieldValueA(${$vs[0]}, $vs[1], $arcID);
                 }
             }
             $inadd_f .= ',' . $vs[0];
             $inadd_v .= " ,'" . ${$vs[0]} . "' ";
         }
     }
 }
 //处理图片文档的自定义属性
 if ($litpic != '') {
     $flag = 'p';
 }
 $body = HtmlReplace($body, -1);
 //生成文档ID
 $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $mid);
 if (empty($arcID)) {
     ShowMsg("无法获得主键,因此无法进行后续操作!", "-1");
     exit;
 }
 //保存到主表
 $inQuery = "INSERT INTO `#@__archives`(id,typeid,sortrank,flag,ismake,channel,arcrank,click,money,title,shorttitle,\r\ncolor,writer,source,litpic,pubdate,senddate,mid,description,keywords)\r\nVALUES ('{$arcID}','{$typeid}','{$sortrank}','{$flag}','{$ismake}','{$channelid}','{$arcrank}','0','{$money}','{$title}','{$shorttitle}',\r\n'{$color}','{$writer}','{$source}','{$litpic}','{$pubdate}','{$senddate}','{$mid}','{$description}','{$keywords}'); ";
 if (!$dsql->ExecuteNoneQuery($inQuery)) {
     $gerr = $dsql->GetError();
     $dsql->ExecuteNoneQuery("Delete From `#@__arctiny` where id='{$arcID}' ");
     ShowMsg("把数据保存到数据库主表 `#@__archives` 时出错,请联系管理员。", "javascript:;");
     exit;
 }
 //软件链接列表
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:soft_add.php

示例8: while

        $dsql->SetQuery("Select id,typename,channeltype From `#@__arctype`");
        $dsql->Execute();
        while ($row = $dsql->GetArray()) {
            fwrite($fp, "\$typeArr[{$row['id']}] = '{$row['typename']}';\r\n");
        }
        fwrite($fp, '?' . '>');
        fclose($fp);
    }
    //引入栏目缓存并看关键字是否有相关栏目内容
    require_once $typenameCacheFile;
    if (isset($typeArr) && is_array($typeArr)) {
        foreach ($typeArr as $id => $typename) {
            //$keywordn = str_replace($typename, ' ', $keyword);
            $keywordn = $keyword;
            if ($keyword != $keywordn) {
                $keyword = HtmlReplace($keywordn);
                $typeid = intval($id);
                break;
            }
        }
    }
}
$keyword = addslashes(cn_substr($keyword, 30));
$typeid = intval($typeid);
if ($cfg_notallowstr != '' && preg_match("#" . $cfg_notallowstr . "#i", $keyword)) {
    ShowMsg("你的搜索关键字中存在非法内容,被系统禁止!", "-1");
    exit;
}
if (($keyword == '' || strlen($keyword) < 2) && empty($typeid)) {
    ShowMsg('关键字不能小于2个字节!', '-1');
    exit;
开发者ID:hensonvip,项目名称:ymroad,代码行数:31,代码来源:search.php

示例9: isset

$action = isset($action) ? trim($action) : '';
if (!$cfg_ml->IsLogin()) {
    ShowMsg("未登录前不充许该操作!", "-1");
    exit;
}
if ($id < 1) {
    ShowMsg("错误,未定义的操作!", "-1");
    exit;
}
if ($action == "save") {
    $svali = GetCkVdValue();
    if (strtolower($vdcode) != $svali || $svali == "") {
        ShowMsg("认证码错误!", "-1");
        exit;
    }
    $subject = cn_substrR(trim(HtmlReplace($subject), 2), 80);
    $text = preg_replace("#<(iframe|script)#i", "", $text);
    if (CountStrLen($text) < 3 || CountStrLen($text) > 1000) {
        ShowMsg("内容字数应该在3-1000个汉字!", "-1");
        exit;
    }
    if (preg_match("#{$cfg_notallowstr}#", $subject) || preg_match("#{$cfg_notallowstr}#", $text)) {
        ShowMsg("含有非法字符!", "-1");
        exit;
    }
    $subject = preg_replace("/{$cfg_replacestr}/", "***", $subject);
    $text = preg_replace("/{$cfg_replacestr}/", "***", $text);
    $userip = GetIP();
    $SetQuery = "INSERT INTO #@__group_guestbook(gid,title,uname,userid,stime,message,ip) ";
    $SetQuery .= "VALUES('{$id}','{$subject}','" . $cfg_ml->M_UserName . "','" . $cfg_ml->M_ID . "','" . time() . "','{$text}','{$userip}');";
    if ($db->ExecuteNoneQuery($SetQuery)) {
开发者ID:healthguo,项目名称:PHP,代码行数:31,代码来源:guestbookform.php

示例10: dirname

 *  圈子分类设置
 *
 * @version        $Id: group_store.php 1 15:34 2011-1-21 tianya $
 * @package        DedeCMS.Administrator
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once dirname(__FILE__) . "/config.php";
CheckPurview('group_Store');
require_once DEDEINC . '/datalistcp.class.php';
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/");
$id = isset($id) && is_numeric($id) ? $id : 0;
$action = isset($action) ? trim($action) : '';
if ($action == "add") {
    $storename = cn_substrR(HtmlReplace($storename, 2), 20);
    $tops = preg_replace("#[^0-9]#", "", $tops);
    $orders = preg_replace("#[^0-9]#", "", $orders);
    if ($tops < 1) {
        $tops = 0;
    }
    if ($orders < 1) {
        $orders = 0;
    }
    if (empty($storename)) {
        $msg = "错误,分类名不能为空!";
    } else {
        $db->ExecuteNoneQuery("INSERT INTO #@__store_groups(storename,tops,orders) VALUES('" . $storename . "','" . $tops . "','" . $orders . "');");
        $msg = "成功添加分类";
    }
} else {
开发者ID:iabing,项目名称:mzzyc,代码行数:31,代码来源:group_store.php

示例11: HtmlReplace

<?php

/*
	[kuaso!] (C)209-2010 Kuaso Inc.
	
	This is NOT a freeware, use is subject to license terms

	$Id: shoulu.php 2010-01-24 16:17:18Z anjel $
*/
require "../global.php";
$url = HtmlReplace($_GET["ref"]);
if ($url != $config["url"] && stristr($url, "http://")) {
    $url = GetSiteUrl($url);
    $site = $db->get_one("select * from kuaso_sites where url='{$url}'");
    if (empty($site)) {
        $array = array('url' => $url, 'spider_depth' => $config["spider_depth"], 'indexdate' => time(), 'addtime' => time());
        $db->insert("kuaso_sites", $array);
    }
    $site = $db->get_one("select * from kuaso_sites where url='{$url}'");
    if (!empty($site)) {
        $ip = ip();
        //$referer=$_SERVER['HTTP_REFERER'];
        $v = $db->get_one("select * from kuaso_stat_visitor where v_ip='" . $ip . "' and v_time>='" . (time() - 86400 * 1) . "'");
        if (empty($v)) {
            $array = array('v_time' => time(), 'v_ip' => $ip);
            $db->insert("kuaso_stat_visitor", $array);
            $db->query("update kuaso_sites set com_time='" . time() . "',com_count_ip=com_count_ip+1 where url='" . $url . "'");
        }
    }
    $site = $db->get_one("select * from kuaso_sites where url='{$url}'");
    if (!empty($site)) {
开发者ID:dalinhuang,项目名称:shopexts,代码行数:31,代码来源:shoulu.php

示例12: checkData

  </div>
  <!--login start-->
  <div class="login" style="position: relative;">
    <div class="login_month"></div>
    <div class="login_month_img1"></div>
    <div class="login_month_img"></div>
    <div class="login_top"></div>
    <div class="login_middle">
      <div class="login_middle_img"></div>
      <div class="login_middle_img1" style="background-position: -416px -46px;"></div>
      <div class="login_middle_clear"></div>
	<form action=\'login.php\' METHOD=post onSubmit="return checkData()">
	<input type="hidden" name="action" value="login">
      <table class="login_table" border="0" cellspacing="0">
			';
$msg = HtmlReplace($_GET['msg']);
if (empty($msg)) {
    echo '请输入用户名';
} else {
    echo $msg;
}
echo '			</td>
		</tr>
		<tr>
      <form name="form" method="post" action="/s/web__login.asp?action=login">
		
      <table class="login_table" border="0" cellspacing="0">
        <tbody><tr>
          <td class="login_table_text1">用户名</td>
          <td class="login_table_text1_1"><input class="login_table_text1_input" name="entered_login"id="entered_login"  maxlength="50" style="border-color: rgb(132, 161, 189); font-weight: bold; font-family: Verdana,Arial,Helvetica,sans-serif; ime-mode: disabled;" type="text" ></td>
          <td class="login_table_text1_img" title="$ Googie.cn"></td>
开发者ID:tanny2015,项目名称:DataStructure,代码行数:31,代码来源:login.php

示例13: dolistform

function dolistform()
{
    global $db;
    $site_id = $_POST['site_id'];
    $do_action = HtmlReplace($_POST['do_action']);
    for ($i = 0; $i < count($site_id); $i++) {
        $site_id_str = $site_id_str . $site_id[$i] . ',';
    }
    $site_id_str = rtrim($site_id_str, ',');
    if (empty($site_id_str)) {
        return;
    }
    if ($do_action == 'del') {
        $sql = 'delete from ve123_sites where site_id in(' . $site_id_str . ')';
    }
    $db->query($sql);
    header('location:' . $_SERVER['HTTP_REFERER']);
}
开发者ID:tanny2015,项目名称:DataStructure,代码行数:18,代码来源:sites.php

示例14: dirname

<?php

/**
 * @version        $Id: buy_action.php 1 8:38 2010年7月9日Z tianya $
 * @package        DedeCMS.Member
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once dirname(__FILE__) . "/config.php";
CheckRank(0, 0);
$menutype = 'mydede';
$menutype_son = 'op';
require_once DEDEINC . '/dedetemplate.class.php';
$product = isset($product) ? trim(HtmlReplace($product, 1)) : '';
$mid = $cfg_ml->M_ID;
$ptype = '';
$pname = '';
$price = '';
$mtime = time();
if (isset($pd_encode) && isset($pd_verify) && md5("payment" . $pd_encode . $cfg_cookie_encode) == $pd_verify) {
    parse_str(mchStrCode($pd_encode, 'DECODE'), $mch_Post);
    $product = preg_replace("#[^0-9a-z]#i", "", $mch_Post['product']);
    $pid = preg_replace("#[^0-9a-z]#i", "", $mch_Post['pid']);
    $row = $dsql->GetOne("SELECT * FROM #@__member_operation WHERE mid='{$mid}' And sta=0 AND product='{$product}'");
    if (!isset($row['buyid'])) {
        ShowMsg("请不要重复提交表单!", 'javascript:;');
        exit;
    }
    if (!isset($paytype)) {
        ShowMsg("请选择支付方式!", 'javascript:;');
开发者ID:cwcw,项目名称:cms,代码行数:31,代码来源:buy_action.php

示例15: ShowMsg

 if ($cInfos['issend'] != 1 || $cInfos['ispart'] != 0 || $cInfos['channeltype'] != $channelid || $cInfos['cissend'] != 1) {
     ShowMsg("你所选择的栏目不支持投稿!", "-1");
     exit;
 }
 //文档的默认状态
 if ($cInfos['arcsta'] == 0) {
     $arcrank = 0;
 } else {
     if ($cInfos['arcsta'] == 1) {
         $arcrank = 0;
     } else {
         $arcrank = -1;
     }
 }
 //对保存的内容进行处理
 $title = cn_substrR(HtmlReplace($title, 1), $cfg_title_maxlen);
 $mid = $cfg_ml->M_ID;
 //处理上传的缩略图
 $litpic = MemberUploads('litpic', $oldlitpic, $mid, 'image', '', $cfg_ddimg_width, $cfg_ddimg_height, false);
 if ($litpic != '') {
     SaveUploadInfo($title, $litpic, 1);
 } else {
     $litpic = $oldlitpic;
 }
 //分析处理附加表数据
 $inadd_f = '';
 if (!empty($dede_addonfields)) {
     $addonfields = explode(';', $dede_addonfields);
     if (is_array($addonfields)) {
         foreach ($addonfields as $v) {
             if ($v == '') {
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:archives_sg_edit.php


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