예제 #1
0
 public static function get($id, $name, $type)
 {
     $id = intval($id);
     $name = Replace(VietChar($name));
     $type = Replace(VietChar($type));
     if ($id !== 0) {
         $name = "{$id}-{$name}";
     }
     $url = "/{$type}/{$name}/";
     return SITE_URL . $url;
 }
예제 #2
0
<?php

include_once $_SERVER['DOCUMENT_ROOT'] . "/sitemanage/include/check_master.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/sitemanage/include/top.php";
set_time_limit(0);
$db = new DbMySqli();
$mode = $_REQUEST['mode'];
$kind = $_REQUEST['kind'];
$no = $_REQUEST['no'];
if (!$kind) {
    if (!$mode) {
        $db['bookmark'] = '1';
        $db->update("iroad_log_dlog", "no = '{$no}'");
    }
    if ($mode == "del") {
        $db['bookmark'] = '';
        $db->update("iroad_log_dlog", "no = '{$no}'");
    }
} else {
    if (!$mode) {
        $db['bookmark'] = '1';
        $db->update("iroad_log_test", "no = '{$no}'");
    }
    if ($mode == "del") {
        $db['bookmark'] = '';
        $db->update("iroad_log_test", "no = '{$no}'");
    }
}
Replace($HTTP_REFERER);
예제 #3
0
include_once $_SERVER['DOCUMENT_ROOT'] . "/sitemanage/include/check_master.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/sitemanage/include/top.php";
set_time_limit(0);
$db = new DbMySqli();
$mode = $_REQUEST['mode'];
$checker = $_REQUEST['checker'];
$no = $_REQUEST['no'];
if ($mode == "del_log_1") {
    $db->delete("iroad_log_test", "no = '{$no}'");
}
if ($mode == "del_log_2") {
    $db->delete("iroad_log_dlog", "no = '{$no}'");
}
if ($mode == "del_log_3") {
    for ($i = 0; $i < 10; $i++) {
        if (!$chk[$i]) {
            continue;
        }
        $db->delete("iroad_log_test", "no = '{$chk[$i]}'");
    }
}
if ($mode == "del_log_4") {
    for ($i = 0; $i <= 10; $i++) {
        if (!$chk[$i]) {
            continue;
        }
        $db->delete("iroad_log_dlog", "no = '{$chk[$i]}'");
    }
}
Replace("{$HTTP_REFERER}");
예제 #4
0
}
*/
$splstr = '';
$s = '';
$conn = OpenConn();
$parentid = '';
$title = '';
$lableName = '';
$content = '';
$tempS = '';
$url = '';
$isdisplay = '';
$nCount = '';
//echo('path='.handlePath('./../admin/后台菜单配置.ini'));
$content = getftext(handlePath('./../admin/后台菜单配置.ini'));
$content = Replace($content, "\t", '    ');
$splStr = aspSplit($content, chr(10));
//不用vbCrlf()  是因为在上传到GitHut上去,下载下来它会把后台菜单配置.ini文件编码转成utf-8 20160409
$nCount = 0;
foreach ($splStr as $s) {
    $tempS = $s;
    $s = AspTrim($s);
    if ($tempS != '' && substr(phptrim($s) . ' ', 0, 1) != '#') {
        $nCount = $nCount + 1;
        //总数
        if (substr($tempS, 0, 4) == '    ') {
        } else {
            $parentid = '-1';
        }
        if (trim(LCase($tempS)) == 'end') {
            break;
예제 #5
0
 /**
  * remove multi space in string
  *
  * @param string $pString chuỗi cần remove
  * @return string chuỗi đã được remove
  *
  */
 public function removeMultiSpaceInside($pString)
 {
     return Regex . Replace($pString, @"\\s{2,}", " ");
 }
예제 #6
0
파일: index.php 프로젝트: jeftom/loongsso
<?php

session_start();
include_once "page.inc.php";
$pp = new pp();
$size = 6;
$rs = new SQLite3("guestbook.sdb");
//id, uid, username, reg_time, post_time, ip, ip_pos, content
if (is_array($_SESSION["user"]) && $_POST["book"]) {
    $userip = ip();
    $content = nl2br(stripslashes(Replace($_POST["content"])));
    $query = "INSERT INTO guestbook (uid, username, reg_time, post_time, ip, content) VALUES ('{$_SESSION["user"]["id"]}', '{$_SESSION["user"]["username"]}', '{$_SESSION["user"]["time"]}', '" . time() . "', '{$userip}', '{$content}')";
    $rs->query($query);
    $rs->close();
    echo "<script>alert('发表成功');window.location.href = 'index.php';</script>";
    exit;
}
$co = $rs->fetch_line("SELECT COUNT(*) AS c FROM guestbook");
$page = $pp->show($co["c"], $size);
$list = $rs->fetch_all("SELECT id, uid, username, reg_time, post_time, ip, content FROM guestbook ORDER BY id DESC LIMIT {$pp->limit}");
$rs->close();
function Replace($str)
{
    if (is_null($str)) {
        return $str;
    }
    $word = array("<" => "&lt;", ">" => "&gt;", "'" => "&quot;", '"' => "&quot;");
    return strtr($str, $word);
}
//获取客户端的IP
function ip()
예제 #7
0
}
$text = '<?php if ($products) { ?>';
$pos = Find($file, $text, 1);
if ($pos == 'no') {
    $text = '<?php $summa = 0.0; if ($products) { ?>';
    $pos = Find($file, $text, 1);
    if ($pos == 'no') {
        echo 'PERHAPS Text already replaced in file: ' . $file . ' <br />';
    } else {
        $rep = '<?php $summa = 0.0; $profit = 0.0; if ($products) { ?>';
        Replace($file, $pos, $text, $rep, $error);
        echo 'SUCCESS File: ' . $file . ' Text installed <br />';
    }
} else {
    $rep = '<?php $summa = 0.0; $profit = 0.0; if ($products) { ?>  <!--*suppler*-->';
    Replace($file, $pos, $text, $rep, $error);
    echo 'SUCCESS File: ' . $file . ' Text installed <br />';
}
$text = 'column_total';
$pos = FindAfter2($file, $text, 1);
if ($pos == 'yes') {
    echo 'SUCCESS File: ' . $file . ' Text: <b>' . $text . '</b> already installed <br />';
} else {
    if ($pos == 'no') {
        echo 'FAIL&nbsp;&nbsp;&nbsp;&nbsp;Text: <b>' . $text . '</b> not found in file: ' . $file . ' <br />';
        $error++;
    } else {
        $text = ' 
		   <td class="right"><?php echo $column_profit; ?></td> <!--*suppler*-->
 ';
        Insert($file, $pos, $text, $error);