本文整理汇总了PHP中display_user_menu函数的典型用法代码示例。如果您正苦于以下问题:PHP display_user_menu函数的具体用法?PHP display_user_menu怎么用?PHP display_user_menu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_user_menu函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: session_start
session_start();
//create short variable names
$username = isset($_POST["username"]) ? $_POST["username"] : "";
$password = isset($_POST["password"]) ? $_POST["password"] : "";
//first check whether the user has come from the front page by filling out the form
if ($username && $password) {
//they have just tried to log in
try {
login($username, $password);
//if they are in the database (as in they are a member), register their username to the session ID variable called valid_user
$_SESSION["valid_user"] = $username;
} catch (Exception $e) {
//unsuccessful login
do_html_header("Problem: ");
echo "We could not log you in. You must be logged in to view this page.";
do_html_url("login.php", "Login");
do_html_footer();
exit;
}
}
//start the display
do_html_header("Home");
check_valid_user();
//get the bookmarks this user has saved
if ($url_array = get_user_urls($_SESSION["valid_user"])) {
//gilho instead of session valid user
display_user_urls($url_array);
}
//give menu options
display_user_menu();
do_html_footer();
示例2: do_page_content_member
function do_page_content_member($current_user)
{
?>
<div class="container theme-showcase" role="main">
<div class="page-header">
<h2>Member Page</h2>
<p>You are logged in as <?php
echo $current_user;
?>
.</p>
<p>On this page you can upload a new learning object, modify your learning objects, or change your password.</p>
</div>
<?php
display_user_menu();
?>
</div>
<?php
}