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


PHP get_uri函数代码示例

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


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

示例1: show_error

 function show_error($the_error, $bypass_error = FALSE, $no_connection = 0)
 {
     global $sitename, $adminmail, $cpgdebugger, $userinfo;
     $this->_backtrace();
     $the_error .= "\n\nIn: " . $this->file . " on line: " . $this->line;
     $the_error = 'On ' . (function_exists('get_uri') ? get_uri() : $_SERVER['REQUEST_URI']) . "\n" . $the_error;
     $show = $no_connection || defined('INSTALL') ? 1 : is_admin() || NEXOS_DEBUG;
     if ($show) {
         if (!defined('INSTALL') && is_object($cpgdebugger)) {
             trigger_error($the_error, E_USER_WARNING);
         } else {
             $the_error = '<html><body><center><h1>ERROR</h1><form><textarea rows="8" cols="60">' . htmlspecialchars($the_error, ENT_QUOTES, 'UTF-8') . '</textarea></form></body></html>';
             die($the_error);
         }
     } else {
         if ($adminmail && $adminmail != '') {
             $addr = decode_ip(Security::get_ip());
             $host = isset($_SERVER['REMOTE_HOST']) && $_SERVER['REMOTE_HOST'] != '' ? $_SERVER['REMOTE_HOST'] : gethostbyaddr($addr);
             $the_error .= "\r\n\r\nGuest information:\r\nUser id: " . $userinfo['user_id'] . "\r\nUsername: " . $userinfo['username'] . "\r\nAdmin: " . ($show ? 'Yes' : 'No') . "\r\nIP: {$addr}\r\nHost: {$host}";
             if (!send_mail($mailer_message, $the_error, 1, 'SQL Error on ' . $sitename)) {
                 echo $mailer_message;
             }
         }
     }
     if (!$bypass_error) {
         $errorpage = '<b>A database error has occurred<br /><br />';
         if (NEXOS_DEBUG) {
             $errorpage .= "</b><textarea cols='60' rows='6'>{$the_error}</textarea>";
         } else {
             $errorpage .= 'The webmaster has been notified of the error</b>';
         }
         //header("HTTP/1.0 500 Internal Server Error");
         if (function_exists('cpg_error')) {
             cpg_error($errorpage, 'Database Error');
         } else {
             require_once 'includes/nexos_page.php';
             $errorpage = nexos_header('Database Error') . $errorpage . cpg_footer();
             die($errorpage);
         }
     }
 }
开发者ID:cbsistem,项目名称:nexos,代码行数:41,代码来源:db.php

示例2: html_action_form

/**
 * Format a form in the package actions box
 *
 * @param string $uri The link target
 * @param string $action The action name (passed as HTTP POST parameter)
 * @param string $inner The HTML code to use for the link label
 *
 * @return string The generated HTML code for the action link
 */
function html_action_form($uri, $action, $inner)
{
    if (isset($_COOKIE["AURSID"])) {
        $code = '<form action="' . htmlspecialchars($uri, ENT_QUOTES) . '" ';
        $code .= 'method="post">';
        $code .= '<input type="hidden" name="token" value="';
        $code .= htmlspecialchars($_COOKIE['AURSID'], ENT_QUOTES) . '" />';
        $code .= '<input type="submit" class="button text-button" name="';
        $code .= htmlspecialchars($action, ENT_QUOTES) . '" ';
        $code .= 'value="' . $inner . '" />';
        $code .= '</form>';
    } else {
        $code = '<a href="' . get_uri('/login/', true) . '">';
        $code .= $inner . '</a>';
    }
    return $code;
}
开发者ID:pyp22,项目名称:aurweb,代码行数:26,代码来源:aur.inc.php

示例3: password_reset

/**
 * Change a user's password in the database if reset key and e-mail are correct
 *
 * @param string $hash New MD5 hash of a user's password
 * @param string $salt New salt for the user's password
 * @param string $resetkey Code e-mailed to a user to reset a password
 * @param string $email E-mail address of the user resetting their password
 *
 * @return string|void Redirect page if successful, otherwise return error message
 */
function password_reset($hash, $salt, $resetkey, $email)
{
    $dbh = DB::connect();
    $q = "UPDATE Users ";
    $q .= "SET Passwd = '{$hash}', ";
    $q .= "Salt = '{$salt}', ";
    $q .= "ResetKey = '' ";
    $q .= "WHERE ResetKey != '' ";
    $q .= "AND ResetKey = " . $dbh->quote($resetkey) . " ";
    $q .= "AND Email = " . $dbh->quote($email);
    $result = $dbh->exec($q);
    if (!$result) {
        $error = __('Invalid e-mail and reset key combination.');
        return $error;
    } else {
        header('Location: ' . get_uri('/passreset/') . '?step=complete');
        exit;
    }
}
开发者ID:pyp22,项目名称:aurweb,代码行数:29,代码来源:acctfuncs.inc.php

示例4: array

<?php

/*********************************************
  CPG Dragonfly™ CMS
  ********************************************
  Copyright © 2004-2006 by CPG-Nuke Dev Team
  http://dragonflycms.org

  Dragonfly is released under the terms and conditions
  of the GNU GPL version 2 or any later version

  $Source: /cvs/l10n/polish/errors.php,v $
  $Revision: 1.3 $
  $Author: nanocaiordo $
  $Date: 2010/02/22 11:02:59 $
Encoding test: n-array summation ∑ latin ae w/ acute ǽ
*******************************************************/
if (!defined('CPG_NUKE')) {
    exit;
}
$LNG = array('_SECURITY_STATUS' => array(301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 500 => 'Internal Server Error', 503 => 'Service Unavailable', 800 => 'Bad IP', 801 => 'Spam url in referer header', 802 => 'Unknown user-agent', 803 => 'Flood Protection'), '_SECURITY_MSG' => array(301 => 'The URL that you requested, ' . get_uri() . ', has been moved permanently to a new URI and any future references to this page SHOULD use the new URI.', 302 => 'The URL that you requested, ' . get_uri() . ', has been moved temporarily to a new URI and any future references to this page SHOULD remain.', 400 => 'The URL that you requested, ' . get_uri() . ', was a bad request.', 401 => 'The URL that you requested, ' . get_uri() . ', requires preauthorization to access.', 402 => 'The URL that you requested, ' . get_uri() . ', requires payment to access.', 403 => 'Access to the URL that you requested, ' . get_uri() . ', is forbidden.', 404 => 'The URL that you requested, ' . get_uri() . ', could not be found. Perhaps you either mistyped the URL or we have a broken link.<br /><br />We have logged this error and will correct the problem if it is a broken link.', 500 => 'The URL that you requested, ' . get_uri() . ', resulted in a server configuration error. It is possible that the condition causing the problem will be gone by the time you finish reading this.<br /><br />We have logged this error and will correct the problem.', 503 => 'The URL that you requested, ' . get_uri() . ', is temporarily unavailable.', 800 => 'You are banned from this site due to a bad ip.', 801 => 'You are banned from this site due to a spam url in the referer header.', 802 => 'You are banned from this site due to a unknown user-agent.', 803 => 'You are banned from this site due to ignoring our anti-flood warnings.', '_FLOOD' => 'You are not allowed to flood our system.\\r\\nYou may view our website again after %s seconds', 'Last_warning' => '\\r\\nThis is your last warning, next time you will be banned!'));
开发者ID:cbsistem,项目名称:nexos,代码行数:21,代码来源:errors.php

示例5: user_table

    user_table(uid_from_sid($_COOKIE["AURSID"]));
    ?>
	</div>
	<?php 
}
?>

</div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="/js/bootstrap-typeahead.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $('#pkgsearch-field').typeahead({
        source: function(query, callback) {
            $.getJSON('<?php 
echo get_uri('/rpc');
?>
', {type: "suggest", arg: query}, function(data) {
                callback(data);
            });
        },
        matcher: function(item) { return true; },
        sorter: function(items) { return items; },
        menu: '<ul class="pkgsearch-typeahead"></ul>',
        items: 20,
        updater: function(item) {
            document.location = '/packages/' + item;
            return item;
	}
    }).attr('autocomplete', 'off');
开发者ID:pyp22,项目名称:aurweb,代码行数:30,代码来源:home.php

示例6: in_request

				<input id="id_referer" type="hidden" name="referer" value="<?php 
        echo in_request('referer');
        ?>
" />
				<?php 
    } elseif (isset($_SERVER['HTTP_REFERER'])) {
        ?>
				<input id="id_referer" type="hidden" name="referer" value="<?php 
        echo htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES);
        ?>
" />
				<?php 
    }
    ?>
			</p>
		</fieldset>
	</form>
	<?php 
} else {
    ?>
	<p>
		<?php 
    printf(__("HTTP login is disabled. Please %sswitch to HTTPs%s if you want to login."), '<a href="' . get_uri('/login', true) . '">', '</a>');
    ?>
	</p>
	<?php 
}
?>
</div>
<?php 
html_footer(AURWEB_VERSION);
开发者ID:pyp22,项目名称:aurweb,代码行数:31,代码来源:login.php

示例7: __

	<p>
		<?php 
echo __('Use this form to close the request for package base %s%s%s.', '<strong>', htmlspecialchars($pkgbase_name), '</strong>');
?>
	</p>
	<p>
		<em><?php 
echo __('Note');
?>
:</em>
		<?php 
echo __('The comments field can be left empty. However, it is highly recommended to add a comment when rejecting a request.');
?>
	</p>
	<form action="<?php 
echo get_uri('/pkgbase/');
?>
" method="post">
		<fieldset>
			<input type="hidden" name="reqid" value="<?php 
echo $pkgreq_id;
?>
" />
			<input type="hidden" name="token" value="<?php 
echo htmlspecialchars($_COOKIE['AURSID']);
?>
" />
			<p>
				<label for="id_reason"><?php 
echo __("Reason");
?>
开发者ID:pyp22,项目名称:aurweb,代码行数:31,代码来源:pkgreq_close_form.php

示例8: get_uri

</a></li>
						<?php 
    if (config_get_bool('options', 'disable_http_login') && empty($_SERVER['HTTPS'])) {
        ?>
						<li><a href="<?php 
        echo get_uri('/login/', true);
        ?>
"><?php 
        echo __("Login");
        ?>
</a></li>
						<?php 
    } else {
        ?>
						<li><a href="<?php 
        echo get_uri('/login/');
        ?>
"><?php 
        echo __("Login");
        ?>
</a></li>
						<?php 
    }
    ?>
					<?php 
}
?>
				</ul>
			</div><!-- #archdev-navbar -->
			<!-- Start of main content -->
开发者ID:pyp22,项目名称:aurweb,代码行数:30,代码来源:header.php

示例9: get_uri

 function get_uri()
 {
     global $db, $globals, $routes;
     $seq = 0;
     require_once mnminclude . 'uri.php';
     $new_uri = $base_uri = get_uri($this->title);
     while ((!empty($routes[$new_uri]) || $db->get_var("select count(*) from links where link_uri='{$new_uri}' and link_id != {$this->id}")) && $seq < 20) {
         $seq++;
         $new_uri = $base_uri . "-{$seq}";
     }
     // In case we tried 20 times, we just add the id of the article
     if ($seq >= 20) {
         $new_uri = $base_uri . "-{$this->id}";
     }
     $this->uri = $new_uri;
 }
开发者ID:brainsqueezer,项目名称:fffff,代码行数:16,代码来源:link.php

示例10: person

 public function person($person, $uri)
 {
     $names = SMOBTools::either($person['names'], array("Anonymous"));
     $imgs = SMOBTools::either($person['images'], array(SMOB_ROOT . '../img/avatar-blank.jpg'));
     $homepage = $person['homepage'];
     $weblog = $person['weblog'];
     $knows = $person['knows'];
     $name = $names[0];
     $pic = $imgs[0];
     $ht = "<div class=\"person\">\n";
     $ht .= "<img src=\"{$pic}\" class=\"depiction\" alt=\"Depiction\" />";
     $ht .= "{$name}\n";
     foreach ($homepage as $h) {
         $ht .= " [<a href=\"{$h}\">Website</a>]\n";
     }
     foreach ($weblog as $w) {
         $ht .= " [<a href=\"{$w}\">Blog</a>]\n";
     }
     foreach ($knows as $k) {
         $enc = get_uri($k, 'user');
         $ht .= " [<a href=\"{$enc}\">Friend</a>]\n";
     }
     $ht .= "</div>\n\n";
     return $ht;
 }
开发者ID:anukat2015,项目名称:smob,代码行数:25,代码来源:SMOBTemplate.php

示例11: __

	<p style="color: red;" class="pkgoutput"><?php 
            echo $error;
            ?>
</p>
<?php 
        }
        ?>

<div class="box">
	<h2><?php 
        echo __("Submit a proposal to vote on.");
        ?>
</h2>

	<form action="<?php 
        echo get_uri('/addvote/');
        ?>
" method="post">
		<p>
			<label for="id_user"><?php 
        echo __("Applicant/TU");
        ?>
</label>
			<input type="text" name="user" id="id_user" value="<?php 
        if (!empty($_POST['user'])) {
            print htmlentities($_POST['user'], ENT_QUOTES);
        }
        ?>
" />
			<?php 
        echo __("(empty if not applicable)");
开发者ID:pyp22,项目名称:aurweb,代码行数:31,代码来源:addvote.php

示例12: wp_redirect

<?php

/**
*
* template name: Profile 
*
**/
//if the user us logged in he does not need to enrol again. Maybe he just wants another box
if (!is_user_logged_in()) {
    wp_redirect(get_uri() . "/details/");
    exit;
    //if the user is not logged in then bring him to the registration form
} else {
    wp_redirect(get_uri() . '/dashboard/');
}
?>



开发者ID:roycocup,项目名称:enclothed,代码行数:16,代码来源:profile.php

示例13: get_cache_value

$bool = false;
$ret = get_cache_value($feed_key, $bool);
if ($bool) {
    echo $ret;
    exit;
}
$rss = new RSSCreator20();
$rss->cssStyleSheet = false;
$rss->xslStyleSheet = false;
# Use UTF-8 (fixes FS#10706).
$rss->encoding = "UTF-8";
#All the general RSS setup
$rss->title = "AUR Newest Packages";
$rss->description = "The latest and greatest packages in the AUR";
$rss->link = "{$protocol}://{$host}";
$rss->syndicationURL = "{$protocol}://{$host}" . get_uri('/rss/');
$image = new FeedImage();
$image->title = "AUR";
$image->url = "{$protocol}://{$host}/images/AUR-logo-80.png";
$image->link = $rss->link;
$image->description = "AUR Newest Packages Feed";
$rss->image = $image;
#Get the latest packages and add items for them
$packages = latest_pkgs(20);
while (list($indx, $row) = each($packages)) {
    $item = new FeedItem();
    $item->title = $row["Name"];
    $item->link = "{$protocol}://{$host}" . get_pkg_uri($row["Name"]);
    $item->description = $row["Description"];
    $item->date = intval($row["SubmittedTS"]);
    $item->source = "{$protocol}://{$host}";
开发者ID:pyp22,项目名称:aurweb,代码行数:31,代码来源:rss.php

示例14: __

<h3><?php 
echo __("Recent Updates");
?>
</h3>

<a href="<?php 
echo get_uri('/rss/');
?>
" title="Arch Package Updates RSS Feed" class="rss-icon"><img src="/images/feed-icon-14x14.png" alt="RSS Feed" /></a>

<table>
	<tbody>
		<?php 
foreach ($newest_packages->getIterator() as $row) {
    ?>
		<tr>
			<td class="pkg-name">
				<a href="<?php 
    echo get_pkg_uri($row["Name"]);
    ?>
" title="<?php 
    echo htmlspecialchars($row["Name"]) . ' ' . htmlspecialchars($row["Version"]);
    ?>
"><?php 
    echo htmlspecialchars($row["Name"]) . ' ' . htmlspecialchars($row["Version"]);
    ?>
</a>
			</td>
			<td class="pkg-new">
				<?php 
    if ($row["ModifiedTS"] - $row["SubmittedTS"] < 3600) {
开发者ID:pyp22,项目名称:aurweb,代码行数:31,代码来源:updates_table.php

示例15: get_server

/**
 * Requests the site group and environment to target.
 */
function get_server()
{
    $name = get_input('Server (e.g. @acquia.dev)?', '/@[A-Za-z0-9]*\\.[A-Za-z0-9]*/');
    $uri = get_uri();
    $server = new Server($name, $uri);
    if (DEBUG) {
        print_line('Server specified: ' . $server->name, DEBUG);
        print_line('URI specified: ' . $server->get_formatted_uri(), DEBUG);
    }
    return $server;
}
开发者ID:KCarlile,项目名称:cdt,代码行数:14,代码来源:account.php


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