本文整理汇总了PHP中unescape函数的典型用法代码示例。如果您正苦于以下问题:PHP unescape函数的具体用法?PHP unescape怎么用?PHP unescape使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unescape函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_mtfarkurl
function smarty_function_mtfarkurl($args, &$ctx)
{
$entry = $ctx->stash('entry');
$permalink = $ctx->tag('MTEntryPermalink');
$link = 'http://cgi.fark.com/cgi/fark/farkit.pl';
$link .= '?h=' . htmlentities($entry['entry_title']);
$link .= '&u=' . unescape($permalink);
return $link;
}
示例2: conv_codage
function conv_codage($txt, $d, $enc)
{
if ($d == 'utf8') {
$ret = $enc ? utf8_encode(utf8_encode($txt)) : utf8_decode_b($txt);
} elseif ($d == 'base64') {
$ret = $enc ? base64_encode($txt) : base64_decode($txt);
} elseif ($d == 'htmlentities') {
$ret = $enc ? htmlentities($txt, ENT_QUOTES, 'ISO-8859-15', false) : html_entity_decode($txt);
} elseif ($d == 'url') {
$ret = $enc ? urlencode($txt) : urldecode($txt);
} elseif ($d == 'unescape') {
$ret = $enc ? $ret : unescape($txt, "");
} elseif ($d == 'ascii') {
if ($enc) {
$ret = ascii_encode($txt);
} else {
$ret = mb_convert_encoding($txt, 'ASCII') . "\r";
}
} elseif ($d == 'binary') {
$ret = $enc ? ascii2bin($txt) : bin2ascii($txt);
} elseif ($d == 'bin/dec') {
$ret = $enc ? decbin($txt) : bindec($txt);
} elseif ($d == 'timestamp') {
$ret = $enc ? strtotime($txt) : date('d/m/Y H:i:s', $txt);
} elseif ($d == 'php') {
$ret = clean_code($txt);
}
return stripslashes($ret);
}
示例3: getHttpVal
function getHttpVal($key, $defaultVal)
{
$val = $defaultVal;
if (array_key_exists($key, $_GET)) {
$val = $_GET[$key];
} else {
if (array_key_exists($key, $_POST)) {
$val = $_POST[$key];
}
}
$v = unescape(trim($val));
return $v;
}
示例4: cmd
function cmd($cmd)
{
global $options;
$options = explode(" ", $cmd);
$script = unescape(array_shift($options));
for ($ind = 0; $ind < count($options); $ind++) {
$options[$ind] = unescape($options[$ind]);
}
if (is_file("commands/" . $script . ".php")) {
require_once "commands/" . $script . ".php";
} else {
echo "未找到命令:" . $script;
}
}
示例5: update
public function update()
{
//输出gb2312码,ajax默认转的是utf-8
header("Content-type: text/html; charset=utf-8");
if (!isset($_POST['author']) or !isset($_POST['content'])) {
alert('非法操作!', 3);
}
//读取数据库和缓存
$pl = M('guestbook');
$config = F('basic', '', './Web/Conf/');
//相关判断
if (Session::is_set('posttime')) {
$temp = Session::get('posttime') + $config['postovertime'];
if (time() < $temp) {
echo "请不要连续发布!";
exit;
}
}
//准备工作
if ($config['bookoff'] == 0) {
$data['status'] = 0;
}
//先解密js的escape
$data['author'] = htmlspecialchars(unescape($_POST['author']));
$data['content'] = htmlspecialchars(trim(unescape($_POST['content'])));
$data['title'] = htmlspecialchars(trim(unescape($_POST['title'])));
$data['tel'] = htmlspecialchars(trim(unescape($_POST['tel'])));
$data['ip'] = remove_xss(htmlentities(get_client_ip()));
$data['addtime'] = date('Y-m-d H:i:s');
//处理数据
if ($pl->add($data)) {
Session::set('posttime', time());
if ($config['bookoff'] == 0) {
echo '发布成功,留言需要管理员审核!';
exit;
} else {
echo '发布成功!';
exit;
}
} else {
echo '发布失败!';
exit;
}
}
示例6: __construct
public function __construct($install = false)
{
// Connect to DB (mysqli)
// Compat: if DB_FILE instead of the DSN is defined then assume SQLITE and make a DSN out of it
if (!$install) {
if (!defined('DB_DSN') && defined('DB_FILE')) {
define('DB_DSN', 'sqlite:' . DIR_EXEC . DB_FILE);
}
$this->_db = new PDOe(DB_DSN, null, null, array(PDO::ERRMODE_EXCEPTION));
}
// Instance of Smarty templates system
$this->_smarty = new Smarty();
$this->_smarty->template_dir = DIR_TPL;
$this->_smarty->compile_dir = DIR_TPL_COMPILE;
$this->_smarty->debugging = false;
//$this->_smarty->caching = true;
// Force a new compile for every request (only for dev)
$this->_smarty->force_compile = false;
$this->_smarty->register_modifier('decode', array(&$this, 'decode'));
// Assign constants with Smarty
foreach ($this->_getConstants() as $k => $v) {
$this->smartyAssign($k, $v);
}
$this->_session =& $_SESSION[APP];
$this->_request = unescape($_REQUEST);
$this->_post = unescape($_POST);
$this->_get = unescape($_GET);
$this->_cookie = unescape($_COOKIE);
$this->_files = unescape($_FILES);
$this->_server =& $_SERVER;
$this->_env =& $_ENV;
// Create json class
$this->_json = new Services_JSON();
if ($install) {
$this->_lang = 'en';
}
$this->loadLanguage($this->getLang());
if (isset($this->_request['ajax'])) {
$this->_ajax = true;
}
if (isset($this->_request['tpl'])) {
$this->_tpl = $this->_request['tpl'];
}
}
示例7: update
public function update()
{
//输出utf-8码,ajax默认转的是utf-8
header("Content-type: text/html; charset=utf-8");
if (!isset($_POST['aid']) or !isset($_POST['author']) or !isset($_POST['content'])) {
$this->error('非法操作!');
}
//读取数据库和缓存
$pl = M('pl');
$config = F('basic', '', './Web/Conf/');
$data['ip'] = htmlentities(get_client_ip());
//先解密js的escape
$data['author'] = htmlspecialchars(unescape($_POST['author']));
//使用stripslashes 反转义,防止服务器开启自动转义
$data['content'] = htmlspecialchars(trim(stripslashes(unescape($_POST['content']))));
$data['ptime'] = date('Y-m-d H:i:s');
$data['aid'] = intval($_POST['aid']);
if (Session::is_set('pltime')) {
$temp = Session::get('pltime') + $config['postovertime'];
if (time() < $temp) {
echo "请不要连续发布!";
exit;
}
}
if ($config['pingoff'] == 0) {
$data['status'] = 0;
}
if ($pl->add($data)) {
Session::set('pltime', time());
if ($config['pingoff'] == 0) {
echo "发布成功,评论需要管理员审核!";
exit;
} else {
echo "发布成功!";
exit;
}
} else {
echo "发布失败!";
exit;
}
}
示例8: getLine
function getLine($synset, $w, $comment)
{
# TODO??: avoid colloqial as first entry, otherwise "gehen" has
# a meaning "gehen (umgangssprachlich)" which is confusing?
$str = "";
foreach ($synset as $s) {
# FIXME: some words don't have synonyms, these should be ignored
if ($s != $w || sizeof($synset) == 1) {
$s = avoidPipe($s);
if ($comment != '') {
$str .= "|" . unescape($s . $comment);
} else {
$str .= "|" . unescape($s);
}
}
}
if ($str == "-") {
return "";
}
return $str;
}
示例9: get
public static function get($item, $type = 'any')
{
switch ($type) {
case 'post':
if (isset($_POST[$item])) {
return unescape($_POST[$item]);
}
break;
case 'get':
if (isset($_GET[$item])) {
return unescape($_GET[$item]);
}
break;
case 'any':
if (isset($_POST[$item])) {
return unescape($_POST[$item]);
} elseif (isset($_GET[$item])) {
return unescape($_GET[$item]);
}
break;
}
return '';
}
示例10: mktime
$py = $y - 1;
}
if ($nm > 12) {
$nm = 1;
$ny = $y + 1;
}
$akt = mktime(0, 0, 0, $m, 1, $y);
# aktuelle timestamp
$aka = date('Y-m-d', $akt);
$ake = date('Y-m-d', mktime(0, 0, 0, $m, date('t', $akt), $y));
$jakt = mktime(0, 0, 0, 1, 1, $y);
# atkueller jahr timestamp
$jaka = date('Y-m-d', $jakt);
$jake = date('Y-m-d', mktime(0, 0, 0, 12, date('t', mktime(0, 0, 0, 12, 1, $y)), $y));
$kontodaten = db_result(db_query("SELECT t1 FROM prefix_allg WHERE k = 'kasse_kontodaten'"), 0);
$kontodaten = unescape($kontodaten);
$kontodaten = bbcode($kontodaten);
$tpl = new tpl('kasse.htm');
$tpl->set('kontodaten', $kontodaten);
$tpl->set('minus', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE betrag < 0"), 0));
$tpl->set('plus', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE betrag > 0"), 0));
$tpl->set('saldo', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse"), 0));
$tpl->set('Jminus', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE betrag < 0 AND datum >= '" . $jaka . "' AND datum <= '" . $jake . "'"), 0));
$tpl->set('Jplus', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE betrag > 0 AND datum >= '" . $jaka . "' AND datum <= '" . $jake . "'"), 0));
$tpl->set('Jsaldo', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE datum >= '" . $jaka . "' AND datum <= '" . $jake . "'"), 0));
$tpl->set('Mminus', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE betrag < 0 AND datum >= '" . $aka . "' AND datum <= '" . $ake . "'"), 0));
$tpl->set('Mplus', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE betrag > 0 AND datum >= '" . $aka . "' AND datum <= '" . $ake . "'"), 0));
$tpl->set('Msaldo', db_result(db_query("SELECT ROUND(SUM(betrag),2) FROM prefix_kasse WHERE datum >= '" . $aka . "' AND datum <= '" . $ake . "'"), 0));
$tpl->set('month', $lang[date('F', $akt)]);
$tpl->set('pm', $pm);
$tpl->set('nm', $nm);
示例11: get_config_option
/**
* Get config option from database
*
* @param integer $user_id Current user ID
* @param string $name Parameter name
* @param string $returned_value If a value does exist it will be returned through
* this parameter which is passed by reference
* @return boolean
*/
function get_config_option($user_id, $name, &$returned_value)
{
if (trim($name) === '') {
return false;
}
$query = sprintf('
SELECT `value`
FROM user_preferences
WHERE user %s
AND parameter = "%s";
', is_null($user_id) ? 'IS NULL' : '= \'' . escape_check($user_id) . '\'', $name);
$config_option = sql_value($query, null);
if (is_null($config_option)) {
return false;
}
$returned_value = unescape($config_option);
return true;
}
示例12: exit
require_once 'bbs_public.php';
if (!defined('ROOT')) {
exit('can\'t access!');
}
//暂时允许用户未登录评论!
//验证用户登陆相关操作
//$admin = new action_admin();
if (isset($_POST['reply'])) {
if (!isset($_POST['verify']) || strtolower(trim($_POST['verify'])) != strtolower($_SESSION['verify'])) {
echo -1;
//输入-1表示验证码输入错误!
exit;
}
$data = array();
$_POST['content'] = unescape($_POST['content']);
$data['aid'] = isset($_POST['aid']) ? intval($_POST['aid']) : exit(0);
$data['tid'] = isset($_POST['tid']) ? intval($_POST['tid']) : 0;
$data['content'] = isset($_POST['content']) ? $_POST['content'] : exit(0);
$data['username'] = isset($_COOKIE['username']) ? $_COOKIE['username'] : '';
//$data['userid'] = $admin->userid;
$data['addtime'] = mktime();
$data['ip'] = $_SERVER['REMOTE_ADDR'];
$reply = db_bbs_reply::getInstance();
$r = $reply->inserData($data);
if ($r) {
$archive = db_bbs_archive::getInstance();
$archive->updateClickReply($data['aid'], 'replynum');
$_SESSION['verify'] = '';
echo 1;
//输入1表示成功发表评论
示例13: header
<?php
header('Content-type: text/plain');
// secure page
require 'login.php';
// $debug=true;
debug_msg("User is logged in as " . $username);
$filepath = "users/" . $username;
// File upload details
$filename = $_POST["filename"];
$pathname = "../run/" . $filepath . "/" . $filename . ".xml";
debug_msg("The file is being saved in " . $pathname);
$data = unescape($_POST["data"]);
// Open (create if needs be) the file and write the data
$file = fopen($pathname, "w");
if (file_exists($pathname)) {
fwrite($file, $data);
fclose($file);
debug_msg("File written");
// select database
open_db();
// Is there a file in the DB with this name & path?
$sql = "SELECT file_id FROM file WHERE file_name='{$filename}' AND file_path='{$filepath}';";
$date = date("Y-m-d");
$reply = "File {$filename} ";
if ($key = query_one_item($sql)) {
$sql = "UPDATE file SET file_date='" . $date . "' WHERE file_id = " . $key . ";";
$reply .= "updated.";
} else {
$sql = "INSERT INTO file (file_date, file_author, file_path, file_name) " . "VALUES ('" . $date . "','" . $username . "','" . $filepath . "','" . $filename . "')";
$reply .= "created.";
示例14: iconv
$contect .= "<td nowrap width='40' >序号</td>";
$contect .= "<td nowrap width='270'>企业名称</td>";
$contect .= "<td nowrap >联系人</td>";
$contect .= "<td nowrap >联系电话</td>";
$contect .= "<td nowrap >城市</td>";
$contect .= "<td nowrap style='cursor:hand' onclick=loadmemberbuy('resort','joindate',document.getElementById('nowpage').value,document.getElementById('pagecount').value)>加入日期<span id=joindate>{$joindate}</span></td>";
$contect .= "<td nowrap style='cursor:hand' onclick=loadmemberbuy('resort','lasthf',document.getElementById('nowpage').value,document.getElementById('pagecount').value)>最后回访日期<span id=lasthf>{$lasthf}</span></td>";
$contect .= "<td nowrap >最近回访摘要</td>";
$contect .= "<td nowrap>操作区</td>";
$contect .= "</tr>";
if (!empty($atcompany)) {
$atcompany = iconv('utf-8', 'gbk', unescape($atcompany));
$querywhere .= " and fd_webcus_name like '%{$atcompany}%'";
}
if (!empty($atcity)) {
$atcity = iconv('utf-8', 'gbk', unescape($atcity));
$querywhere .= " and (fd_provinces_name like '%{$atcity}%' or fd_city_name like '%{$atcity}%')";
}
$beginpage = ($page - 1) * $pagecount;
//会员资料
$query = "select fd_webcus_id,fd_webcus_allname,\n fd_city_name , fd_webcus_newtime as joindate ,fd_provinces_name ,\n fd_webcus_lasthfdate as lasthf,fd_webcus_lasthfcontect\n\tfrom tb_webcustomer \n\tleft join tb_city on fd_city_code = fd_webcus_city\n\tleft join tb_provinces on fd_provinces_code = fd_webcus_provinces\n\twhere fd_webcus_erpcusid <> 0 {$querywhere} order by {$sort} {$sorttype} limit {$beginpage},{$pagecount}\n\t";
$db->query($query);
if ($db->nf()) {
$v = 0;
while ($db->next_record()) {
$cusid = $db->f(fd_webcus_id);
if ($v == 0) {
$vv = "where fd_webcus_id = '{$cusid}'";
} else {
$vv .= " or fd_webcus_id = '{$cusid}'";
}
示例15: iconv
$decodedStr .= $charAt;
$pos++;
}
}
if ($iconv_to != "UTF-8") {
$decodedStr = iconv("UTF-8", $iconv_to, $decodedStr);
}
return $decodedStr;
}
require_once '../../config/config.inc.php';
require_once '../../config/db_connect.inc.php';
require_once '../../language_files/language.inc.php';
require_once '../../pages/CCirculation.inc.php';
header("Content-Type: text/xml; charset={$DEFAULT_CHARSET}");
$strFiter = strip_tags($_REQUEST['strFilter']);
$strFiter = ltrim(unescape($strFiter, $DEFAULT_CHARSET));
$objCirculation = new CCirculation();
$arrIndex = $objCirculation->filterUsers($strFiter);
?>
<table cellpadding="2" cellspacing="0" style="background-color:white;" width="100%">
<tbody id="AvailableUsers">
<?php
$nMax = sizeof($arrIndex);
for ($nIndex = 0; $nIndex < $nMax; $nIndex++) {
$arrCurIndex = $arrIndex[$nIndex];
$nUserId = $arrCurIndex['user_id'];
$arrUser = $objCirculation->getUserById($nUserId);
$sid = $nUserId;
?>
<tr onMouseOver="this.style.background = '#ddd;'" onMouseOut="this.style.background = '#fff;'" onClick="document.getElementById('receiver_<?php
echo $sid;