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


PHP get_current_url函数代码示例

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


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

示例1: echo_form

function echo_form()
{
    echo '<form name="doit" method="post" action="' . get_current_url() . '" />';
    echo '<input type="submit" name="verify" value="Run" />';
    echo '<input type="submit" name="verify" value="Test" />';
    echo '</form>';
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:7,代码来源:add_feed_display_relationship.php

示例2: run

 function run()
 {
     if (!reason_user_has_privs($this->admin_page->user_id, 'view_sensitive_data')) {
         echo '<p>Sorry; use of this module is restricted.</p>' . "\n";
         return;
     }
     if (!empty($this->admin_page->request['error_reporting_state'])) {
         switch ($this->admin_page->request['error_reporting_state']) {
             case 'on':
                 override_developer_status(true);
                 break;
             case 'off':
                 override_developer_status(false);
                 break;
         }
     }
     $status = is_developer();
     echo '<form method="post" action="' . htmlspecialchars(get_current_url()) . '">';
     if ($status) {
         echo '<h3>In-page error reporting is currently ON.</h3>' . "\n";
         echo '<input type="submit" value="Turn Error Reporting Off" /><input type="hidden" name="error_reporting_state" value="off" />';
     } else {
         echo '<h3>In-page error reporting is currently OFF.</h3>' . "\n";
         echo '<input type="submit" value="Turn Error Reporting On" /><input type="hidden" name="error_reporting_state" value="on" />';
     }
     echo '</form>';
     echo '<p>Note: changes made via this form only last for the duration of the current session.</p>';
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:28,代码来源:error_visibility.php

示例3: echo_form2

function echo_form2()
{
    echo '<p>This phase of the script will <strong>RESET ALL EXISTING RELATIONSHIP SORT ORDER DATA FOR THE minisite_page_to_text_blurb ALLOWABLE RELATIONSHIP</strong> - so do not run it unless ';
    echo 'this is what you actually intend to do. If you have never run this script before on this reason instance, you should run it in order to preserve the previous sort order of text blurbs on pages.</p>';
    echo '<form name="doit" method="post" action="' . get_current_url() . '" />';
    echo '<input type="submit" name="verify2" value="Run" />';
    echo '<input type="submit" name="verify2" value="Test" />';
    echo '</form>';
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:9,代码来源:text_blurb_reorient.php

示例4: secure_failtoban_validate_login_form

/**
 * called to validate WP login form
 */
function secure_failtoban_validate_login_form($args)
{
    if (isset($_POST['log']) && isset($_POST['pwd'])) {
        if (secure_is_failtoban()) {
            header('Location: ' . get_current_url(true));
            exit;
        }
    }
}
开发者ID:studio-montana,项目名称:custom,代码行数:12,代码来源:failtoban.php

示例5: init

 function init($args = array())
 {
     if ($this->params['force_secure'] && HTTPS_AVAILABLE && !on_secure_page()) {
         header('Location: ' . get_current_url(securest_available_protocol()));
         exit(0);
     }
     // Check for an existing database connection so we can restore it when we're done
     $this->db_conn = get_current_db_connection_name();
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:9,代码来源:arbitrary_include.php

示例6: get_demo_url

function get_demo_url($page, $hash = null)
{
    $index = settings('interface_filename');
    $req = get_current_url();
    if (substr($req, -1) != '/') {
        $req = dirname($req);
    }
    return $req . '/' . $index . '?page=' . $page . (!is_null($hash) ? '#' . $hash : '');
}
开发者ID:atelierspierrot,项目名称:demo-builder,代码行数:9,代码来源:demo-builder-lib.php

示例7: authenticate

 public function authenticate()
 {
     nocache_headers();
     $is_allowed = $this->isAllowed();
     if (!is_user_logged_in() && !$is_allowed) {
         $current_url = get_current_url();
         wp_redirect(add_query_arg('redirect_to', urlencode($current_url), $this->settings['logout_redirect']));
         exit;
     }
 }
开发者ID:creativelittledots,项目名称:wp-kit-core,代码行数:10,代码来源:FormAuth.php

示例8: show_navigation

function show_navigation($start_with)
{
    start_form("", "get");
    if ($start_with > 0) {
        echo get_href("<p>Previous", set_var(get_current_url(), "start", max(0, $start_with - SHOW_ITEMS)));
    } else {
        echo "Previous";
    }
    echo " ";
    echo get_href("Next", set_var(get_current_url(), "start", $start_with + SHOW_ITEMS));
    end_form();
}
开发者ID:HuniyaArif,项目名称:mosesdecoder,代码行数:12,代码来源:index.php

示例9: force_login_to_site

function force_login_to_site($redirect_url = NULL, $whitelist = array())
{
    // https://github.com/kevinvess/wp-force-login
    add_action('init', function () use($redirect_url, $whitelist) {
        if (!is_user_logged_in()) {
            $url = get_current_url();
            if (preg_replace('/\\?.*/', '', $url) != preg_replace('/\\?.*/', '', wp_login_url()) && !in_array($url, $whitelist)) {
                wp_safe_redirect(wp_login_url($redirect_url ? $redirect_url : $url), 302);
                exit;
            }
        }
    });
}
开发者ID:bjorn-ali-goransson,项目名称:Wordpress-Theme,代码行数:13,代码来源:force_login_to_site.php

示例10: secure_captcha_validate_login_form

/**
 * called to validate WP login form
 */
function secure_captcha_validate_login_form($args)
{
    if (isset($_POST['log']) && isset($_POST['pwd'])) {
        if (!secure_captcha_validate_result(SECURE_CAPTCHA_FIELD . '-login')) {
            $redirect_to = "";
            if (isset($_REQUEST['redirect_to'])) {
                $redirect_to = $_REQUEST['redirect_to'];
            }
            header('Location: ' . get_current_url() . "?redirect_to=" . urlencode($redirect_to));
            exit;
        }
    }
}
开发者ID:studio-montana,项目名称:custom,代码行数:16,代码来源:captcha.php

示例11: init

 public static function init($token = false, $secret = false)
 {
     if (!$token || !$secret) {
         $_SESSION['TwitterRedirect'] = get_current_url();
         Controller::redirect('?q=twitter/request_auth');
         return false;
     } else {
         self::$auth_token = $token;
         self::$auth_secret = $secret;
         self::$started = true;
         self::$oauth = OAuth::getInstance('twitter');
         return true;
     }
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:14,代码来源:TwitterAPI.obj.php

示例12: template_redirect

 public static function template_redirect()
 {
     if (!self::is_page()) {
         return false;
     }
     if (theme_cache::is_user_logged_in()) {
         $account_navs = apply_filters('account_navs', []);
         if (!isset($account_navs[get_query_var('tab')])) {
             wp_redirect(add_query_arg('tab', 'dashboard', self::get_url()));
         }
     } else {
         wp_redirect(theme_custom_sign::get_tabs('login', get_current_url())['url']);
         die;
     }
 }
开发者ID:ClayMoreBoy,项目名称:mx,代码行数:15,代码来源:custom-account.php

示例13: init

 function init($args = array())
 {
     parent::init($args);
     if (!$this->get_authentication()) {
         $extra_params = '';
         if (!empty($this->msg_uname)) {
             $extra_params .= '&msg_uname=' . $this->msg_uname;
         }
         if (!empty($this->redir_link_text)) {
             $extra_params .= '&redir_link_text=' . $this->redir_link_text;
         }
         $dest_page = urlencode(get_current_url());
         header('Location: ' . REASON_LOGIN_URL . '?dest_page=' . $dest_page . $extra_params);
         exit;
     }
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:16,代码来源:default_with_auth.php

示例14: private_template_include

 /**
  * template_include filter (allow to override template hierarchy)
 * @return template path
 */
 function private_template_include($template)
 {
     $post_id = get_the_id();
     if (is_home()) {
         $post_id = get_option('page_for_posts');
     }
     if (tool_private_is_private_post($post_id) && !is_user_logged_in()) {
         $private_template = locate_ressource(CUSTOM_PLUGIN_TOOLS_FOLDER . PRIVATE_TOOL_NAME . '/templates/tool-private-template.php');
         if (!empty($private_template)) {
             $template = $private_template;
         } else {
             wp_redirect(wp_login_url(get_current_url(true)));
         }
     }
     return $template;
 }
开发者ID:studio-montana,项目名称:custom,代码行数:20,代码来源:private.php

示例15: get_queried_page

 function get_queried_page($depth = 0)
 {
     $curr_url = get_current_url();
     if ($depth != -1) {
         $curr_url = strtok($curr_url, '?');
     }
     $curr_uri = str_replace(get_bloginfo('url'), '', $curr_url);
     if ($depth) {
         $curr_uri_ary = array_filter(explode('/', $curr_uri));
         $curr_uri = trailingslashit(implode('/', array_splice($curr_uri_ary, 0, $depth)));
     }
     $page = get_page_by_path($curr_uri);
     if ($page) {
         return $page;
     }
     return null;
 }
开发者ID:kishandchips,项目名称:thebankcorporate,代码行数:17,代码来源:functions.php


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