本文整理汇总了PHP中getCurrentUrl函数的典型用法代码示例。如果您正苦于以下问题:PHP getCurrentUrl函数的具体用法?PHP getCurrentUrl怎么用?PHP getCurrentUrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCurrentUrl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
public function view()
{
$title = $this->params[0];
$curl = getCurrentUrl();
$extPath = '/app/ext/addtoany';
$html=<<<HTML
<!-- AddToAny BEGIN -->
<a class="a2a_dd" href="#"><img src="$extPath/img/share_save.png" width="171" height="16" border="0" alt="Share"/></a>
<script type="text/javascript">
function my_addtoany_onready() { // A custom "onReady" function for AddToAny
a2a_config.target = '.a2a_dd';
a2a.init('page');
}
var a2a_config = { // Setup AddToAny "onReady" callback
tracking_callback: ["ready", my_addtoany_onready]
};
a2a_config.linkname = "$title";
a2a_config.linkurl = "$curl";
(function(){ // Load AddToAny script asynchronously
var a = document.createElement('script');
a.type = 'text/javascript';
a.async = true;
a.src = '$extPath/js/page.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(a, s);
})();
</script>
<!-- AddToAny END -->
HTML;
echo $html;
}
示例2: sendEmailConfirmation
function sendEmailConfirmation($db, $email)
{
$sql = 'SELECT * FROM users WHERE email = :email';
$stmt = $db->prepare($sql);
$stmt->bindValue('email', $email);
$stmt->execute();
if ($result = $stmt->fetch()) {
$id = $result["id"];
$key = $result["secret"];
$url = getCurrentUrl() . "confirm.php?id=" . $id . '&key=' . $key;
$subject = "Email de confirmation - mailinglist";
$message = '<html><body>';
$message .= '<h1>Veuillez cliquer sur le lien suivant pour valider votre inscription à la newsletter (mailinglist) :</h1>';
$message .= '<a href="' . $url . '">' . $url . '</a>';
$message .= '<br/><br/><br/><br/><br/>';
$message .= '<a href="' . getCurrentUrl() . "unsubscribe.php?id=" . $id . '&key=' . $key . '" style="font-size: 10px; text-align: center;">Se désinscrire</a>';
$message .= '</body></html>';
$headers = "From: no-reply@mailinglist.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$envoi = mail($email, $subject, $message, $headers);
if ($envoi) {
return true;
}
}
}
示例3: getAuthSubUrl
function getAuthSubUrl()
{
$next = getCurrentUrl();
$scope = 'https://picasaweb.google.com/lh/myphotos?noredirect=1';
$secure = 0;
$session = 1;
return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
}
示例4: getAuthSubUrl
/**
* Returns the AuthSub URL which the user must visit to authenticate requests
* from this application.
*
* Uses getCurrentUrl() to get the next URL which the user will be redirected
* to after successfully authenticating with the Google service.
*
* @return string AuthSub URL
*/
function getAuthSubUrl()
{
$next = getCurrentUrl();
$scope = 'http://www.google.com/base/feeds/';
$secure = false;
$session = true;
return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session);
}
示例5: getRedirectUrl
function getRedirectUrl()
{
$currUrl = getCurrentUrl();
if (!stristr($currUrl, '?')) {
$currUrl .= "?";
}
$currUrl = preg_replace('/&lang_code=\\w{2}$|&lang_code=\\w{2}&/i', '', $currUrl, 1, $count);
return $currUrl;
}
示例6: __construct
/**
* Construct an abstract element with the given options
* Sets the url property to the current url for convenience
* @param array $options Array of key => value options to use with this element
*/
public function __construct(array $options = array())
{
// Set the name of this button
$this->name = strtolower(substr(get_called_class(), strrpos(get_called_class(), '\\') + 1));
// Most buttons take a url, add it for convenience
$options = array_merge(array('url' => getCurrentUrl()), $options);
foreach ($options as $name => $value) {
$this->{$name} = $value;
}
$this->templateDir = __DIR__ . '/../../../templates/' . strtolower(getClassName($this));
}
示例7: index
/**
* 系统主页
*/
public function index()
{
//读取团购
$deal_model = M("Deal");
$deal = $deal_model->order("ctime")->find();
$this->assign("deal", $deal);
//分享处理
$share['url'] = urlencode(getCurrentUrl());
$share['content'] = urlencode($deal['title']);
$this->assign("share", $share);
$this->display();
}
示例8: getPagination
/**
* Created by PhpStorm.
* User: caipeichao
* Date: 14-3-10
* Time: PM7:40
*/
function getPagination($totalCount, $countPerPage = 10)
{
$pageKey = 'page';
//获取当前页码
$currentPage = intval($_REQUEST[$pageKey]) ? intval($_REQUEST[$pageKey]) : 1;
//计算总页数
$pageCount = ceil($totalCount / $countPerPage);
//如果只有1页,就没必要翻页了
if ($pageCount <= 1) {
return '';
}
$Page = new \Think\Page($totalCount, $countPerPage);
// 实例化分页类 传入总记录数和每页显示的记录数
return $Page->show();
//定义返回结果
$html = '';
//添加头部
$html .= '<div class="pagination">';
//添加上一页的按钮
if ($currentPage > 1) {
$prevUrl = addUrlParam(getCurrentUrl(), array($pageKey => $currentPage - 1));
$html .= "<li><a class=\"\" href=\"{$prevUrl}\">«</a></li>";
} else {
$html .= "<li class=\"disabled\"><a>«</a></li>";
}
//添加各页面按钮
for ($i = 1; $i <= $pageCount; $i++) {
$pageUrl = addUrlParam(getCurrentUrl(), array($pageKey => $i));
if ($i == $currentPage) {
$html .= "<li class=\"active\"><a class=\"active\" href=\"{$pageUrl}\">{$i}</a></li>";
} else {
$html .= "<li><a class=\"\" href=\"{$pageUrl}\">{$i}</a></li>";
}
}
//添加下一页按钮
if ($currentPage < $pageCount) {
$nextUrl = addUrlParam(getCurrentUrl(), array($pageKey => $currentPage + 1));
$html .= "<li><a class=\"\" href=\"{$nextUrl}\">»</a></li>";
} else {
$html .= "<li class=\"disabled\"><a>»</a></li>";
}
//收尾
$html .= '</div>';
return $html;
}
示例9: logged_in
function logged_in()
{
global $script_path;
// If session is not found or IP has changed or the uid is not found the user is not logged in
if (empty($_SESSION['uid']) || empty($_SESSION['ip']) || $_SESSION['ip'] != $_SERVER['REMOTE_ADDR'] || checkUid($_SESSION['uid']) == false) {
setcookie("last_url", getCurrentUrl());
// Save last url in a cookie
if (getSetting("use_redirect_notloggedin", "text") == "true") {
header('Location: ' . getSetting("redirect_notloggedin", "text"));
} else {
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off") {
header('Location: https://www.' . getCurrentDomain() . $script_path . 'login.php?m=1');
} else {
header('Location: http://www.' . getCurrentDomain() . $script_path . 'login.php?m=1');
}
}
exit;
}
}
示例10: define
<?php
if (!defined('__URL__')) {
define('__URL__', getCurrentUrl());
}
if (!defined('__PUBLIC__')) {
define('__PUBLIC__', setPublicUrl('/Public'));
}
示例11:
?>
',
'text_editor':'<?php
echo CONFIG_URL_TEXT_EDITOR;
?>
',
'image_editor':'<?php
echo CONFIG_URL_IMAGE_EDITOR;
?>
',
'download':'<?php
echo CONFIG_URL_DOWNLOAD;
?>
',
'present':'<?php
echo Tools::safeOutput(getCurrentUrl());
?>
',
'home':'<?php
echo CONFIG_URL_HOME;
?>
',
'view':'<?php
echo CONFIG_URL_LIST_LISTING;
?>
'
};
var permits = {'del':<?php
echo CONFIG_OPTIONS_DELETE ? 1 : 0;
?>
, 'cut':<?php
示例12: authenticate
function authenticate($singleUseToken = null)
{
$sessionToken = isset($_SESSION['sessionToken']) ? $_SESSION['sessionToken'] : null;
// If there is no AuthSub session or one-time token waiting for us,
// redirect the user to Google Health's AuthSub handler to get one.
if (!$sessionToken && !$singleUseToken) {
$next = getCurrentUrl();
$secure = 1;
$session = 1;
$authSubHandler = 'https://www.google.com/h9/authsub';
$permission = 1;
// 1 - allows reading of the profile && posting notices
$authSubURL = Zend_Gdata_AuthSub::getAuthSubTokenUri($next, SCOPE, $secure, $session, $authSubHandler);
$authSubURL .= '&permission=' . $permission;
echo '<a href="' . $authSubURL . '">Link your Google Health Account</a>';
exit;
}
$client = new Zend_Gdata_HttpClient();
$client->setAuthSubPrivateKeyFile(HEALTH_PRIVATE_KEY, null, true);
// Convert an AuthSub one-time token into a session token if needed
if ($singleUseToken && !$sessionToken) {
$sessionToken = Zend_Gdata_AuthSub::getAuthSubSessionToken($singleUseToken, $client);
$_SESSION['sessionToken'] = $sessionToken;
}
$client->setAuthSubToken($sessionToken);
return $client;
}
示例13: getCurrentUrl
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">アカウント修正</h4>
</div>
<div class="modal-body">
Loading...
</div>
</div>
</div>
</div>
<?php
$newSeminarStudentUrl = Yii::app()->createUrl('admin/student/NewStudentManagement');
$registeredStudentsUrl = $this->createUrl('admin/student/editStudentManagement');
$currentUrl = getCurrentUrl(array_merge($_GET,$searchParams?$searchParams:array(),array('page'=>$pages->currentPage+1)));
$baseUrl = Yii::app()->baseUrl;
$cs = Yii::app()->getClientScript();
$cs->registerScript(
'toggleModel',
'
$("#new-registration").click(function() {
$("#myModalLabel").text("受講者アカウント登録");
$(".modal-body").load("' . $newSeminarStudentUrl . '", function() {
$("#myModal").modal("show").width(700).css("margin-left",-350);
$(".datepicker").datepicker().on("changeDate", function() {$(this).datepicker("hide")});
});
});
function newStudentManager() {
$("#myModalLabel").text("アカウント登録");
showLoading();
示例14: pmxc_constructPageIndex
/**
* Handle a block pageindex
*/
function pmxc_constructPageIndex($items, $pageitems, $addRestoreTop = true, $startpage = null)
{
// hide pageindex if only one page..
if ($items > $pageitems) {
if (!is_null($startpage)) {
$this->startpage = $startpage;
} else {
$this->startpage = 0;
}
$cururl = preg_replace('~pgkey[a-zA-Z0-9_\\-\\;\\=\\/]+pg[0-9\\=\\/]+~', '', getCurrentUrl(true)) . 'pgkey=' . $this->cfg['uniID'] . ';pg=%1$d;';
$this->postspage = $pageitems;
$this->pageindex = constructPageIndex($cururl, $this->startpage, $items, $pageitems, true);
$this->pageindex = preg_replace('/\\;start\\=([\\%\\$a-z0-9]+)/', '', $this->pageindex);
if (!empty($addRestoreTop)) {
$this->pageindex = str_replace('href="', 'onclick="pmxWinGetTop(\'' . $this->cfg['uniID'] . '\')" href="', $this->pageindex);
}
}
}
示例15: getCurrentUrl
<label for="admin_email" class="col-sm-2 control-label">eMail Kontaktformulare / Main contact eMail-Address:</label>
<div class="col-sm-10">
<input class="form-control" type="email" name="contact_email" id="contact_email" value="" size="50" required="required" placeholder="eMail Kontaktformulare / Main contact eMail-Address">
<small><span class="helpBlock" class="help-block">Die gewünschte eMail-Adresse für Kontaktformulare. / Main contact eMail-Address for forms.</span></small>
<br><br><br>
</div>
</div>
<div class="row">
<div class="col-md-12" style="text-align:center;">
<input class="btn btn-primary btn-lg" type="submit" value="ConstructrCMS installieren / Setup ConstructrCMS">
</div>
</div>
</form>
<br><br><br><br>
<div class="row">
<div class="col-md-12" style="text-align:center;">
<p><small>ConstructrCMS | <a href="http://phaziz.com">phaziz.com</a></small></p>
</div>
</div>
</div>
<script src="<?php
echo getCurrentUrl();
?>
/CONSTRUCTR-CMS/ASSETS/jquery/jquery-2.1.4.min.js"></script>
<script src="<?php
echo getCurrentUrl();
?>
/CONSTRUCTR-CMS/ASSETS/materialize/js/materialize.min.js"></script>
</body>
</html>