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


PHP curPageURL函数代码示例

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


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

示例1: getCallbackURL

function getCallbackURL($callbackPage)
{
    $urlbase = curPageURL();
    $urlbase = substr($urlbase, 0, strrpos($urlbase, '/'));
    $urlbase = $urlbase . "/" . $callbackPage;
    return $urlbase;
}
开发者ID:jferraioli,项目名称:DocuSign-eSignature-SDK,代码行数:7,代码来源:autoAppApply.php

示例2: write_log

function write_log($logfile = 'log.txt')
{
    if (($time = $_SERVER['REQUEST_TIME']) == '') {
        $time = time();
    }
    if (($remote_addr = $_SERVER['REMOTE_ADDR']) == '') {
        $remote_addr = "REMOTE_ADDR_UNKNOWN";
    }
    $date = date("Y-m-d H:i:s", $time);
    if ($fd = @fopen($logfile, "a")) {
        fputs($fd, "-------------\r\n");
        $result = fputcsv($fd, array($date, $remote_addr, curPageURL()));
        fputs($fd, "POST:");
        fputs($fd, print_r($_POST, true));
        fputs($fd, "GET:");
        fputs($fd, print_r($_GET, true));
        fclose($fd);
        if ($result > 0) {
            return 'done';
        } else {
            return 'Unable to write to';
        }
    } else {
        return 'Unable to open log!';
    }
}
开发者ID:vallejocc,项目名称:php_logger,代码行数:26,代码来源:logger.php

示例3: social_share_buttons

function social_share_buttons()
{
    echo '<script>    
    !function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if(!d.getElementById(id)) {js = d.createElement(s); js.id = id; js.src = "//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);}} (document, "script", "twitter-wjs");  
    window.___gcfg = {lang: \'en\'};
    (function() {var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true; po.src = \'https://apis.google.com/js/plusone.js\'; var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s);})();
    (function(d, s, id) {  var js, fjs = d.getElementsByTagName(s)[0];  if (d.getElementById(id)) return;  js = d.createElement(s); js.id = id;  js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.3";  fjs.parentNode.insertBefore(js, fjs);}(document, \'script\', \'facebook-jssdk\'));
    </script>
    <div id="fb-root"></div>
    <div class="social-share-wrapper">
        <span class="social-share-facebook">
            <div class="fb-like" data-href="' . curPageURL() . '" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true"></div>
        </span>
        <span class="social-share-facebook">
            <div class="fb-send" data-href="' . curPageURL() . '" data-colorscheme="light"></div>
        </span>
        <span class="social-share-twitter">
            <a href="https://twitter.com/share" class="twitter-share-button" data-lang="en"></a>
        </span>
        <span class="social-share-google">
            <div class="g-plusone" data-size="medium"></div>
        </span>
        <div class="clearfix"></div>
    </div>';
}
开发者ID:david-ievents,项目名称:iEvents.com-Dev,代码行数:25,代码来源:functions.php

示例4: form_open

 /**
  * Form Declaration
  *
  * Creates the opening portion of the form.
  *
  * @param   string  the URI segments of the form destination
  * @param   array   a key/value pair of attributes
  * @param   array   a key/value pair hidden data
  * @return  string
  * @example
  * $attributes = array('class' => 'email', 'id' => 'myform');
  * echo form_open('test/test.php', $attributes);
  */
 function form_open($action = '', $attributes = array(), $hidden = array())
 {
     // $CI =& DB::get_instance();
     // If no action is provided then set to the current url
     if (!$action) {
         $action = curPageURL();
         // $action = Config::get('site/site_url');
     } elseif (strpos($action, '://') === FALSE) {
         $a = Config::get('site/site_url');
         $action = $a . $action;
     }
     $attributes = _attributes_to_string($attributes);
     if (stripos($attributes, 'method=') === FALSE) {
         $attributes .= ' method="post"';
     }
     if (stripos($attributes, 'accept-charset=') === FALSE) {
         $attributes .= ' accept-charset="' . strtolower(Config::get("site/charset")) . '"';
     }
     $form = '<form action="' . $action . '"' . $attributes . ">\n";
     // Add CSRF field if enabled, but leave it out for GET requests and requests to external websites
     if (Config::get('csrf/csrf_protection') === TRUE) {
         $hidden[Config::get('csrf/csrf_token_name')] = Token::generateCSRF();
     }
     if (is_array($hidden)) {
         foreach ($hidden as $name => $value) {
             $form .= '<input type="hidden" name="' . $name . '" value="' . escape($value) . '" style="display:none;" />' . "\n";
         }
     }
     return $form;
 }
开发者ID:astcode,项目名称:ast-base-PHP-framework,代码行数:43,代码来源:form_helper.php

示例5: curPageFolder

function curPageFolder()
{
    $path = curPageURL();
    $last = strripos($path, "/");
    $new = substr($path, 0, $last);
    $start = strripos($new, "/") + 1;
    return substr($path, $start, $last - $start);
}
开发者ID:jassimtalat,项目名称:KMRD_2010,代码行数:8,代码来源:header.php

示例6: auto_redir

function auto_redir(&$a, $contact_nick)
{
    // prevent looping
    if (x($_REQUEST, 'redir') && intval($_REQUEST['redir'])) {
        return;
    }
    if (!$contact_nick || $contact_nick === $a->user['nickname']) {
        return;
    }
    if (local_user()) {
        // We need to find out if $contact_nick is a user on this hub, and if so, if I
        // am a contact of that user. However, that user may have other contacts with the
        // same nickname as me on other hubs or other networks. Exclude these by requiring
        // that the contact have a local URL. I will be the only person with my nickname at
        // this URL, so if a result is found, then I am a contact of the $contact_nick user.
        //
        // We also have to make sure that I'm a legitimate contact--I'm not blocked or pending.
        $baseurl = $a->get_baseurl();
        $domain_st = strpos($baseurl, "://");
        if ($domain_st === false) {
            return;
        }
        $baseurl = substr($baseurl, $domain_st + 3);
        $nurl = normalise_link($baseurl);
        $r = q("SELECT id FROM contact WHERE uid = ( SELECT uid FROM user WHERE nickname = '%s' LIMIT 1 )\n\t\t        AND nick = '%s' AND self = 0 AND ( url LIKE '%%%s%%' or nurl LIKE '%%%s%%' ) AND blocked = 0 AND pending = 0 LIMIT 1", dbesc($contact_nick), dbesc($a->user['nickname']), dbesc($baseurl), dbesc($nurl));
        if (!$r || !count($r) || $r[0]['id'] == remote_user()) {
            return;
        }
        $r = q("SELECT * FROM contact WHERE nick = '%s'\n\t\t        AND network = '%s' AND uid = %d  AND url LIKE '%%%s%%' LIMIT 1", dbesc($contact_nick), dbesc(NETWORK_DFRN), intval(local_user()), dbesc($baseurl));
        if (!($r && count($r))) {
            return;
        }
        $cid = $r[0]['id'];
        $dfrn_id = $orig_id = $r[0]['issued-id'] ? $r[0]['issued-id'] : $r[0]['dfrn-id'];
        if ($r[0]['duplex'] && $r[0]['issued-id']) {
            $orig_id = $r[0]['issued-id'];
            $dfrn_id = '1:' . $orig_id;
        }
        if ($r[0]['duplex'] && $r[0]['dfrn-id']) {
            $orig_id = $r[0]['dfrn-id'];
            $dfrn_id = '0:' . $orig_id;
        }
        // ensure that we've got a valid ID. There may be some edge cases with forums and non-duplex mode
        // that may have triggered some of the "went to {profile/intro} and got an RSS feed" issues
        if (strlen($dfrn_id) < 3) {
            return;
        }
        $sec = random_string();
        q("INSERT INTO `profile_check` ( `uid`, `cid`, `dfrn_id`, `sec`, `expire`)\n\t\t\tVALUES( %d, %s, '%s', '%s', %d )", intval(local_user()), intval($cid), dbesc($dfrn_id), dbesc($sec), intval(time() + 45));
        $url = curPageURL();
        logger('auto_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG);
        $dest = $url ? '&destination_url=' . $url : '';
        goaway($r[0]['poll'] . '?dfrn_id=' . $dfrn_id . '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest);
    }
    return;
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:56,代码来源:redir.php

示例7: guess_base_url

function guess_base_url()
{
    $url = curPageURL();
    $url_parts = explode('/', $url);
    //take install off the end of the url
    array_pop($url_parts);
    array_pop($url_parts);
    $guessed_base_url = implode('/', $url_parts);
    return $guessed_base_url;
}
开发者ID:neevan1e,项目名称:Done,代码行数:10,代码来源:finish.php

示例8: getsignature

function getsignature()
{
    $url = curPageURL();
    $urls = explode("#", $url);
    $url = $urls[0];
    $ex = "jsapi_ticket=" . $GLOBALS["aticket"] . "&noncestr=" . $GLOBALS["noncestr"] . "&timestamp=" . $GLOBALS["timestamp"] . "&url=";
    if (!isset($_SESSION)) {
        session_start();
    }
    $_SESSION['signature_ex'] = $ex;
    $str = $ex . $url;
    return sha1($str);
}
开发者ID:power-pieces,项目名称:xiu_pin_pile_box,代码行数:13,代码来源:share.php

示例9: Main

function Main()
{
    echo curPageURL() . '<br />';
    $ch = curl_init();
    $data = array('nome' => 'Regis', 'secao' => 'exames');
    curl_setopt($ch, CURLOPT_URL, "HTTP://localhost/testes/cURL/pagina1.php");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    $output = curl_exec($ch);
    curl_close($ch);
    echo "Retorno obtido: " . $output;
}
开发者ID:GoPlaceIn,项目名称:siacc,代码行数:13,代码来源:pagina2.php

示例10: appendQuery

function appendQuery($query, $entities = true)
{
    $url = curPageURL();
    if ($entities) {
        $url = str_replace("&", "&amp;", $url);
    }
    $amp = $entities ? "&amp;" : "&";
    if (strpos($url, "?") !== FALSE) {
        $url .= $amp . $query;
    } else {
        $url .= "?" . $query;
    }
    return $url;
}
开发者ID:AmphibiaWeb,项目名称:amphibian-disease-tracker,代码行数:14,代码来源:helpers.php

示例11: CheckMultiProxy

function CheckMultiProxy($proxies, $timeout, $proxy_type)
{
    $data = array();
    foreach ($proxies as $proxy) {
        $parts = explode(':', trim($proxy));
        $url = strtok(curPageURL(), '?');
        $data[] = $url . '?ip=' . $parts[0] . "&port=" . $parts[1] . "&timeout=" . $timeout . "&proxy_type=" . $proxy_type;
    }
    $results = multiRequest($data);
    $holder = array();
    foreach ($results as $result) {
        $holder[] = json_decode($result, true)["result"];
    }
    $arr = array("results" => $holder);
    echo json_encode($arr);
}
开发者ID:samuel-allan,项目名称:FastProxyChecker,代码行数:16,代码来源:checker.php

示例12: find_a_similar_page

function find_a_similar_page() {

	if( is_404() ){

		$pageSlugsRaw = array();
		$cleanSinglePageSlug = array();
		$mixin = array();
		$removeMe = site_url();
		$url = curPageURL();
		$closestValue = 100;
		$closestLink = '';
		$lastUrlQueryString = array_pop( explode( "/", $url ) );

		$args = array(
			'sort_order' => 'ASC',
			'sort_column' => 'post_title',
			'hierarchical' => 1,
			'post_type' => 'page',
			'post_status' => 'publish'
		);
		$pages = get_pages( $args ); 

		foreach ( $pages as $key ) {
			$pageLink = get_page_link( $key->ID );
			array_push( $pageSlugsRaw, $pageLink );
		}

		foreach( $pageSlugsRaw as $pageLink ) {
			$wholeLink = $pageLink;
			$trimedLink = str_replace( $removeMe, '', $pageLink );
			$similarityLevel = levenshtein( $trimedLink, $lastUrlQueryString );

			array_push( $mixin, array( 'similar' => $similarityLevel, 'link' => $wholeLink ) );
		}

		for( $i = 0; $i < count($mixin); $i++ ){
			if( $closestValue > $mixin[$i]['similar'] ){
				$closestValue = $mixin[$i]['similar'];
				$closestLink = $mixin[$i]['link'];
			}
		}

		wp_redirect( $closestLink );
	}

}
开发者ID:helloworld-digital,项目名称:katemorgan,代码行数:46,代码来源:redirect-to-similar.php

示例13: ondefault

 function ondefault()
 {
     $title = '服务中心';
     $all_num = $_ENV['question']->total_question();
     $left_game = $_ENV['question']->get_question_game();
     //$banner_list = $_ENV['banner']->get_banner_list(true);
     $common_list = $_ENV['common_question']->get_common_list(true);
     $taglist = $_ENV['tag']->get_tag();
     // 判断用户是否登录
     $url = 'http://' . config::FRONT_LOGIN_DOMAIN . '/?returnUrl=' . curPageURL();
     $imgType = intval($this->get[2]);
     $Qtype = intval($this->get[3]);
     if ($imgType > 5) {
         $imgType = 0;
     }
     include template('index');
 }
开发者ID:eappl,项目名称:prototype,代码行数:17,代码来源:index.php

示例14: showThreadWithTable

function showThreadWithTable($threadwithtype, $type)
{
    $gc_current_URL = curPageURL();
    //获取最后一个/之前得所有字符串
    //$gc_current_URL=strchr($gc_current_URL,"/",true);
    $arr = explode('/', $gc_current_URL);
    $gc_current_URL = "";
    //$curren_URL="";
    for ($i = 0; $i < count($arr) - 1; $i++) {
        $gc_current_URL .= $arr[$i] . "/";
    }
    if ($type) {
        include template("excellent_shared/threadwithtype.tpl");
    } else {
        include template("excellent_shared/threadwithtype2.tpl");
    }
}
开发者ID:littlelove2013,项目名称:upload,代码行数:17,代码来源:function_showThreadWithTable.php

示例15: protegerme

function protegerme($solo_salir = false, $solo_iniciado = false, $niveles = array())
{
    if (!$solo_iniciado) {
        if (_F_usuario_cache('nivel') == _N_administrador || in_array(_F_usuario_cache('nivel'), $niveles)) {
            return;
        }
    } else {
        if (S_iniciado()) {
            return;
        }
    }
    if (!$solo_salir) {
        header('Location: ' . PROY_URL . 'inicio?ref=' . curPageURL());
    }
    ob_end_clean();
    exit;
}
开发者ID:vlad88sv,项目名称:UFS,代码行数:17,代码来源:seguridad.php


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