本文整理汇总了PHP中setUri函数的典型用法代码示例。如果您正苦于以下问题:PHP setUri函数的具体用法?PHP setUri怎么用?PHP setUri使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setUri函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
update('pagers', $g, "post_id = '{$urledit}' ");
}
if (!empty($_POST['medidas'])) {
$h['post_id'] = $postedit['id'];
$h['measure'] = htmlspecialchars(mysql_real_escape_string($_POST['medidas']));
update('measures', $h, "post_id = '{$urledit}' ");
}
if (!empty($_POST['papel_tipo'])) {
$i['post_id'] = $postedit['id'];
$i['paper_type'] = htmlspecialchars(mysql_real_escape_string($_POST['papel_tipo']));
update('papers', $i, "post_id = '{$urledit}' ");
}
$f['data'] = formDate($f['date']);
unset($f['date']);
if ($postedit['titulo'] != $f['titulo']) {
$f['url'] = setUri($f['titulo']);
$readPostUri = read('posts', "WHERE url LIKE '%{$f['url']}%' AND id != '{$urledit}'");
if ($readPostUri) {
$f['url'] = $f['url'] . '-' . count($readPostUri);
$readPostUri = read('posts', "WHERE url = '{$f['url']}' AND id != '{$urledit}'");
if ($readPostUri) {
$f['url'] = $f['url'] . '_' . time();
}
}
} else {
$f['url'] = $postedit['url'];
}
if (!empty($_FILES['thumb']['tmp_name'])) {
$pasta = '../uploads/';
$ano = date('Y');
$mes = date('m');
示例2: define
//define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE CAKE CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}
if (function_exists('ini_set')) {
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS);
define('APP_PATH', null);
define('CORE_PATH', null);
} else {
define('APP_PATH', ROOT . DS . APP_DIR . DS);
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
}
require CORE_PATH . 'cake' . DS . 'basics.php';
require APP_PATH . 'config' . DS . 'core.php';
require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
$bootstrap = true;
$uri = setUri();
/**
* As mod_rewrite (or .htaccess files) is not working, we need to take care
* of what would normally be rewritten, i.e. the static files in app/webroot/
*/
if ($uri === '/' || $uri === '/index.php') {
$_GET['url'] = '/';
require APP_DIR . DS . WEBROOT_DIR . DS . 'index.php';
} else {
$elements = explode('/index.php', $uri);
if (!empty($elements[1])) {
$path = $elements[1];
} else {
$path = '/';
}
$_GET['url'] = $path;
示例3: htmlspecialchars
echo '<span class="alert alert-error" style="float:left;">Desculpe, Você não tem permissão para gerenciar as categorias!</span>';
} else {
?>
<section class="span8">
<a href="index2.php?exe=posts/categorias" title="Voltar" class="pull-right btn-primary">Voltar</a>
<?php
if (isset($_POST['sendForm'])) {
$f['nome'] = htmlspecialchars(stripcslashes(mysql_real_escape_string($_POST['nome'])));
$f['date'] = htmlspecialchars(stripcslashes(mysql_real_escape_string($_POST['data'])));
$f['tipo'] = 'dropmenu';
if (in_array('', $f)) {
echo '<span class="alert alert-info" style="float:left;">Preencha todos os Campos!</span>';
} else {
$f['data'] = formDate($f['date']);
unset($f['date']);
$f['url'] = setUri($f['nome']);
$readCatUri = read('cat', "WHERE url LIKE '%{$f['url']}%'");
if ($readCatUri) {
$f['url'] = $f['url'] . '-' . count($readCatUri);
$readCatUri = read('cat', "WHERE url = '{$f['url']}'");
if ($readCatUri) {
$f['url'] = $f['url'] . '_' . time();
}
}
create('cat', $f);
$_SESSION['return'] = '<span class="alert alert-success">Categoria criada com sucesso!</span>';
header('Location: index2.php?exe=posts/categorias-create');
}
} elseif (!empty($_SESSION['return'])) {
echo $_SESSION['return'];
unset($_SESSION['return']);
示例4: htmlspecialchars
}
}
?>
<section class="span8">
<a href="index2.php?exe=posts/categorias" title="Voltar" class="pull-right btn-primary">Voltar</a>
<?php
if (isset($_POST['sendForm'])) {
$f['nome'] = htmlspecialchars(stripcslashes(mysql_real_escape_string($_POST['nome'])));
$f['date'] = htmlspecialchars(stripcslashes(mysql_real_escape_string($_POST['data'])));
if (in_array('', $f)) {
echo '<span class="alert alert-info">Preencha todos os Campos!</span>';
} else {
$f['id_pai'] = $urlpai;
$f['data'] = formDate($f['date']);
unset($f['date']);
$f['url'] = $prefix . '-' . setUri($f['nome']);
$readCatUri = read('cat', "WHERE url LIKE '%{$f['url']}%'");
if ($readCatUri) {
$f['url'] = $f['url'] . '-' . count($readCatUri);
$readCatUri = read('cat', "WHERE url = '{$f['url']}'");
if ($readCatUri) {
$f['url'] = $f['url'] . '_' . time();
}
}
create('cat', $f);
$_SESSION['return'] = '<span class="alert alert-success">Categoria atualizada com sucesso!</span>';
header('Location: index2.php?exe=posts/categorias-subcreate&idpai=' . $urlpai . '&uri=' . $prefix);
}
} elseif (!empty($_SESSION['return'])) {
echo $_SESSION['return'];
unset($_SESSION['return']);
示例5: date
<?php
if (isset($_POST['sg'])) {
if (!empty($_FILES['thumb']['tmp_name'])) {
$pasta = "../upload/";
$ano = date('Y');
$mes = date('m');
if (!file_exists($pasta . $ano) && is_dir($pasta . $ano)) {
mkdir($pasta . $ano, 0755);
}
if (!file_exists($pasta . $ano . '/' . $mes)) {
mkdir($pasta . $ano . '/' . $mes, 0755);
}
$img = $_FILES['thumb'];
$ext = substr($img['name'], -3);
$thumb = $ano . '/' . $mes . '/' . setUri($img['name']);
uploadImage($img['tmp_name'], setUri($img['name']), '600', $pasta . $ano . '/' . $mes . '/');
}
$d = date('Y-m-d H:i:s');
$campos = array('post_id' => $postId, 'img' => $thumb, 'data' => $d);
create("galeria", $campos);
}
?>
<?php
// deleta imagem no bando e na pasta upload
if (!empty($_GET['iddel'])) {
$iddel = $_GET['iddel'];
$img = $_GET['img'];
$pasta = $pasta = "../upload/";
if (file_exists($pasta . $img)) {
unlink($pasta . $img);
示例6: printAuth
}
}
/**
* Security DATA PRINT for API AUTH
*
* @category Pulse
* @package Pulse
* @author Ferdinand Martin
* @since File available since Release 1.0.0
*/
function printAuth()
{
return json_encode(array('PubicKey' => $_SESSION['rest.pu']));
}
/**
* Security ERROR PRINT for API AUTH
*
* @category Pulse
* @package Pulse
* @author Ferdinand Martin
* @since File available since Release 1.0.0
*/
function errorAuth()
{
return json_encode(array('status' => 'error', 'code' => '401', 'message' => 'Authorization Required.', 'exception' => 'Missing public-key authorization header.'));
}
// @URIs External URL definition
setUri('documentationUrl', 'http://doc.pulseframework.com');
setUri('communityUrl', 'http://doc.pulseframework.com');
setUri('tutosUrl', 'http://doc.pulseframework.com');
示例7: baseUrl
/**
* Returns a base URL.
*
* @return string Base URL
*/
function baseUrl()
{
$htaccess = null;
$base = $this->admin;
$this->webroot = '';
if (defined('BASE_URL')) {
$base = BASE_URL . $this->admin;
}
$docRoot = env('DOCUMENT_ROOT');
$scriptName = env('PHP_SELF');
$r = null;
$appDirName = str_replace('/', '\\/', preg_quote(APP_DIR));
$webrootDirName = str_replace('/', '\\/', preg_quote(WEBROOT_DIR));
if (preg_match('/' . $appDirName . '\\' . DS . $webrootDirName . '/', $docRoot)) {
$this->webroot = '/';
if (preg_match('/^(.*)\\/index\\.php$/', $scriptName, $r)) {
if (!empty($r[1])) {
return $base . $r[1];
}
}
} else {
if (defined('BASE_URL')) {
$webroot = setUri();
$htaccess = preg_replace('/(?:' . APP_DIR . '\\/(.*)|index\\.php(.*))/i', '', $webroot) . APP_DIR . '/' . $webrootDirName . '/';
}
if (preg_match('/^(.*)\\/' . $appDirName . '\\/' . $webrootDirName . '\\/index\\.php$/', $scriptName, $regs)) {
if (APP_DIR === 'app') {
$appDir = null;
} else {
$appDir = '/' . APP_DIR;
}
!empty($htaccess) ? $this->webroot = $htaccess : ($this->webroot = $regs[1] . $appDir . '/');
return $base . $regs[1] . $appDir;
} elseif (preg_match('/^(.*)\\/' . $webrootDirName . '([^\\/i]*)|index\\\\.php$/', $scriptName, $regs)) {
!empty($htaccess) ? $this->webroot = $htaccess : ($this->webroot = $regs[0] . '/');
return $base . $regs[0];
} else {
!empty($htaccess) ? $this->webroot = $htaccess : ($this->webroot = '/');
return $base;
}
}
return $base;
}
示例8: mysql_real_escape_string
?>
/tpl/images/logo.png" alt="Logo <?php
echo SITENAME;
?>
" title="<?php
echo SITENAME;
?>
- Entretenimento, games, internet e tecnologia" />
</a>
</div><!-- /header-logo -->
<div class="search">
<?php
if (isset($_POST['search'])) {
$pesquisa = mysql_real_escape_string($_POST['s']);
$pesquisa = setUri($pesquisa);
header('Location: ' . BASE . '/pesquisa/' . $pesquisa);
}
?>
<form name="search" action="" method="post">
<label><input type="text" name="s" value="" /></label>
<input type="submit" class="btn" value="" name="search" />
</form>
</div><!-- /headr-search -->
<ul class="hnav">
<li><a title="<?php
echo SITENAME;
?>
| Home" href="<?php
setHome();
示例9: htmlspecialchars
if (function_exists(getUser)) {
if (!getUser($_SESSION['autUser']['id'], '1')) {
echo '<span class="alert alert-error" style="float:left;">Desculpe, Você não tem permissão para gerenciar as cores!</span>';
} else {
?>
<section class="span8">
<a href="index2.php?exe=system/cores" title="Artigos" class="pull-right label label-info">Listar Cores</a>
<?php
if (isset($_POST['sendForm'])) {
$f['color_name'] = htmlspecialchars(mysql_real_escape_string($_POST['color_name']));
$f['color_hexadecimal'] = htmlspecialchars(mysql_real_escape_string($_POST['color_hexadecimal']));
$f['color_rgb'] = htmlspecialchars(mysql_real_escape_string($_POST['color_rgb']));
if (in_array('', $f)) {
echo '<span class="alert alert-info">Informe todos os Campos!</span>';
} else {
$f['color_name_url'] = setUri($f['color_name']);
$readPostUri = read('colors', "WHERE color_name_url LIKE '%{$f['color_name_url']}%'");
if ($readPostUri) {
$f['color_name_url'] = $f['color_name_url'] . '-' . count($readPostUri);
$readPostUrl = read('colors', "WHERE color_name_url = '{$f['color_name_url']}'");
if ($readPostUrl) {
$f['color_name_url'] = $f['color_name_url'] . '_' . time();
}
}
create('colors', $f);
$_SESSION['return'] = '<span class="alert alert-success">Categoria criada com sucesso!</span>';
header('Location: index2.php?exe=system/cores-create');
}
} elseif (!empty($_SESSION['return'])) {
echo $_SESSION['return'];
unset($_SESSION['return']);