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


PHP show_header函数代码示例

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


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

示例1: show_error

/**
   show error-message and terminate
*/
function show_error($error, $extra = NULL)
{
    _error($error . " : " . $extra);
    // we do not know whether the language module was already loaded
    $errmsg = isset($GLOBALS["error_msg"]) ? $GLOBALS["error_msg"]["error"] : "ERROR";
    $backmsg = isset($GLOBALS["error_msg"]) ? $GLOBALS["error_msg"]["back"] : "BACK";
    show_header($errmsg);
    ?>
	<center>
        <h2><?php 
    echo $errmsg;
    ?>
</h2>
        <?php 
    echo $error;
    ?>
        <h3> <a href="javascript:window.history.back()"><?php 
    echo $backmsg;
    ?>
</a><h3>
        <?php 
    if ($extra != NULL) {
        echo " - " . $extra;
    }
    ?>
    </center>
    <?php 
    show_footer();
    exit;
}
开发者ID:rterbush,项目名称:nas4free,代码行数:33,代码来源:error.php

示例2: login

function login()
{
    if (isset($_SESSION["s_user"])) {
        _debug("login(): session detected");
        //if ( ! user_activate( $_SESSION["s_user"], $_SESSION["s_pass"] ))
        if (!user_activate($_SESSION["s_user"], base64_decode($_SESSION["s_pass"]))) {
            _debug("Failed to activate user " . $_SESSION['s_user']);
            logout();
        }
    } else {
        if (isset($_POST["p_pass"])) {
            $p_pass = $_POST["p_pass"];
        } else {
            $p_pass = "";
        }
        if (isset($_POST["p_user"])) {
            _debug("login(): login authentication");
            // Check Login
            //if ( ! user_activate( stripslashes( $_POST["p_user"] ), md5( stripslashes( $p_pass ) ) ) )
            if (!user_activate(stripslashes($_POST["p_user"]), $p_pass)) {
                global $error_msg;
                show_error($error_msg["login_failed"] . ": " . $_POST["p_user"]);
            }
            // authentication sucessfull
            _debug("user '" . $_POST["p_user"] . "' successfully authenticated");
            // set language
            $_SESSION['language'] = qx_request("lang", "en");
            return;
        } else {
            // Ask for Login
            show_header($GLOBALS["messages"]["actlogin"]);
            echo "<CENTER><BR><TABLE width=\"300\"><TR><TD colspan=\"2\" class=\"header\" nowrap><B>";
            echo $GLOBALS["messages"]["actloginheader"] . "</B></TD></TR>\n<FORM name=\"login\" action=\"";
            echo make_link("login", NULL, NULL) . "\" method=\"post\">\n";
            echo "<TR><TD>" . $GLOBALS["messages"]["miscusername"] . ":</TD><TD align=\"right\">";
            echo "<INPUT name=\"p_user\" type=\"text\" size=\"25\"></TD></TR>\n";
            echo "<TR><TD>" . $GLOBALS["messages"]["miscpassword"] . ":</TD><TD align=\"right\">";
            echo "<INPUT name=\"p_pass\" type=\"password\" size=\"25\"></TD></TR>\n";
            // NAS4Free Code
            //Select box and auto language detection array
            echo "<TR><TD>" . gettext("Detected Language:<br />(Change if needed)") . "</TD><TD align=\"right\">";
            @(include "./_lang/_info.php");
            // End NAS4Free Code
            echo "<TR><TD colspan=\"2\" align=\"right\"><INPUT type=\"submit\" value=\"";
            echo $GLOBALS["messages"]["btnlogin"] . "\"></TD></TR>\n</FORM></TABLE><BR></CENTER>\n";
            ?>
<script language="JavaScript1.2" type="text/javascript">
                <!--
                if(document.login) document.login.p_user.focus();
            // -->
            </script><?php 
            show_footer();
            exit;
        }
    }
}
开发者ID:sdoney,项目名称:nas4free,代码行数:56,代码来源:login.php

示例3: login

function login()
{
    //print_r($GLOBALS['__SESSION']);
    if (isset($GLOBALS['__SESSION']["s_user"])) {
        if (!activate_user($GLOBALS['__SESSION']["s_user"], $GLOBALS['__SESSION']["s_pass"])) {
            logout();
        }
        $GLOBALS["lang"] = $GLOBALS['__SESSION']["s_lang"];
        $GLOBALS["language"] = $GLOBALS['__SESSION']["s_lang"];
        require "./_lang/" . $GLOBALS["language"] . ".php";
        require "./_lang/" . $GLOBALS["language"] . "_mimes.php";
    } else {
        if (isset($GLOBALS['__POST']["p_pass"])) {
            $p_pass = $GLOBALS['__POST']["p_pass"];
        } else {
            $p_pass = "";
        }
        if (isset($GLOBALS['__POST']["p_user"])) {
            // Check Login
            if (!activate_user(stripslashes($GLOBALS['__POST']["p_user"]), md5(stripslashes($p_pass)))) {
                logout();
            }
            $GLOBALS['__SESSION']["s_lang"] = $GLOBALS['__POST']["lang"];
            return;
        } else {
            // Ask for Login
            show_header($GLOBALS["messages"]["actlogin"]);
            echo "<BR><TABLE width=\"300\"><TR><TD colspan=\"2\" class=\"header\" nowrap><B>";
            echo $GLOBALS["messages"]["actloginheader"] . "</B></TD></TR>\n<FORM name=\"login\" action=\"";
            echo make_link("login", NULL, NULL) . "\" method=\"post\">\n";
            echo "<TR><TD>" . $GLOBALS["messages"]["miscusername"] . ":</TD><TD align=\"right\">";
            echo "<INPUT name=\"p_user\" type=\"text\" size=\"25\"></TD></TR>\n";
            echo "<TR><TD>" . $GLOBALS["messages"]["miscpassword"] . ":</TD><TD align=\"right\">";
            echo "<INPUT name=\"p_pass\" type=\"password\" size=\"25\"></TD></TR>\n";
            echo "<TR><TD>" . $GLOBALS["messages"]["misclang"] . ":</TD><TD align=\"right\">";
            echo "<SELECT name=\"lang\">\n";
            @(include "./_lang/_info.php");
            echo "</SELECT></TD></TR>\n";
            echo "<TR><TD colspan=\"2\" align=\"right\"><INPUT type=\"submit\" value=\"";
            echo $GLOBALS["messages"]["btnlogin"] . "\"></TD></TR>\n</FORM></TABLE><BR>\n";
            ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	if(document.login) document.login.p_user.focus();
// -->
</script><?php 
            show_footer();
            exit;
        }
    }
}
开发者ID:ZenaVault,项目名称:FreeNAS-Source,代码行数:51,代码来源:login.php

示例4: show_error

function show_error($error, $extra = NULL)
{
    // show error-message
    show_header($GLOBALS["error_msg"]["error"]);
    echo "<CENTER><BR>" . $GLOBALS["error_msg"]["error"] . ":" . "<BR><BR>\n";
    echo $error . "\n<BR><BR><A HREF=\"javascript:window.history.back()\">";
    echo $GLOBALS["error_msg"]["back"] . "</A>";
    if ($extra != NULL) {
        echo " - " . $extra;
    }
    echo "<BR><BR></CENTER>\n";
    show_footer();
    exit;
}
开发者ID:BackupTheBerlios,项目名称:redaxo-addons,代码行数:14,代码来源:error.php

示例5: show_msg

function show_msg($message, $url_forward = '')
{
    if ($url_forward) {
        $message = "<a href=\"{$url_forward}\">{$message} (跳轉中...)</a><script>setTimeout(\"window.location.href ='{$url_forward}';\", 1);</script>";
    }
    show_header();
    print <<<END
\t<table>
\t<tr><td>{$message}</td></tr>
\t</table>
END;
    show_footer();
    exit;
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:14,代码来源:update_qqconnect.php

示例6: rename_item

function rename_item($dir, $item)
{
    // rename directory or file
    $mainframe =& JFactory::getApplication();
    if (($GLOBALS["permissions"] & 01) != 01) {
        show_error($GLOBALS["error_msg"]["accessfunc"]);
    }
    if (isset($GLOBALS['__POST']["confirm"]) && $GLOBALS['__POST']["confirm"] == "true") {
        $newitemname = $GLOBALS['__POST']["newitemname"];
        $newitemname = trim(basename(stripslashes($newitemname)));
        if ($newitemname == '') {
            show_error($GLOBALS["error_msg"]["miscnoname"]);
        }
        if (!nx_isFTPMode()) {
            $abs_old = get_abs_item($dir, $item);
            $abs_new = get_abs_item($dir, $newitemname);
        } else {
            $abs_old = get_item_info($dir, $item);
            $abs_new = get_item_info($dir, $newitemname);
        }
        if (@$GLOBALS['nx_File']->file_exists($abs_new)) {
            show_error($newitemname . ": " . $GLOBALS["error_msg"]["itemdoesexist"]);
        }
        $perms_old = $GLOBALS['nx_File']->fileperms($abs_old);
        $ok = $GLOBALS['nx_File']->rename(get_abs_item($dir, $item), get_abs_item($dir, $newitemname));
        if (nx_isFTPMode()) {
            $abs_new = get_item_info($dir, $newitemname);
        }
        $GLOBALS['nx_File']->chmod($abs_new, $perms_old);
        if ($ok === false || PEAR::isError($ok)) {
            show_error('Could not rename ' . $item . ' to ' . $newitemname);
        }
        $msg = sprintf($GLOBALS['messages']['success_rename_file'], $item, $newitemname);
        $mainframe->redirect(make_link("list", $dir, null), $msg);
    }
    show_header($GLOBALS['messages']['rename_file']);
    // Form
    echo '<br /><form method="post" action="';
    echo make_link("rename", $dir, $item) . "\">\n";
    echo "<input type=\"hidden\" name=\"confirm\" value=\"true\" />\n";
    echo "<input type=\"hidden\" name=\"item\" value=\"" . stripslashes($GLOBALS['__GET']["item"]) . "\" />\n";
    // Submit / Cancel
    echo "<table>\n<tr><tr><td colspan=\"2\">\n";
    echo "<label for=\"newitemname\">" . $GLOBALS["messages"]["newname"] . ":</label>&nbsp;&nbsp;&nbsp;<input name=\"newitemname\" id=\"newitemname\" type=\"text\" size=\"60\" value=\"" . stripslashes($_GET['item']) . "\" /><br /><br /><br /></td></tr>\n";
    echo "<tr><tr><td>\n<input type=\"submit\" value=\"" . $GLOBALS["messages"]["btnchange"];
    echo "\"></td>\n<td><input type=\"button\" value=\"" . $GLOBALS["messages"]["btncancel"];
    echo "\" onclick=\"javascript:location='" . make_link("list", $dir, NULL) . "';\">\n</td></tr></form></table><br />\n";
}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:48,代码来源:fun_rename.php

示例7: login

function login()
{
    global $my;
    if (isset($GLOBALS['__SESSION']["s_user"])) {
        if (!activate_user($GLOBALS['__SESSION']["s_user"], $GLOBALS['__SESSION']["s_pass"])) {
            logout();
        }
    } else {
        if (isset($GLOBALS['__POST']["p_pass"])) {
            $p_pass = $GLOBALS['__POST']["p_pass"];
        } else {
            $p_pass = "";
        }
        if (isset($GLOBALS['__POST']["p_user"])) {
            // Check Login
            if (!activate_user(stripslashes($GLOBALS['__POST']["p_user"]), md5(stripslashes($p_pass)))) {
                logout();
            }
            return;
        } else {
            // Ask for Login
            show_header($GLOBALS["messages"]["actlogin"]);
            echo "<br><table width=\"300\"><tr><td colspan=\"2\" class=\"header\" nowrap><b>";
            echo $GLOBALS["messages"]["actloginheader"] . "</b></td></tr>\n<form name=\"login\" action=\"";
            echo make_link("login", null, null) . "\" method=\"post\">\n";
            echo "<tr><td>" . $GLOBALS["messages"]["miscusername"] . ":</td><td align=\"right\">";
            echo "<input name=\"p_user\" type=\"text\" value=\"" . $my->username . "\" size=\"25\"></td></tr>\n";
            echo "<tr><td>" . $GLOBALS["messages"]["miscpassword"] . ":</td><td align=\"right\">";
            echo "<input name=\"p_pass\" type=\"password\" size=\"25\"></td></tr>\n";
            echo "<tr><td>" . $GLOBALS["messages"]["misclang"] . ":</td><td align=\"right\">";
            echo "<select name=\"lang\">\n";
            @(include _QUIXPLORER_PATH . "/languages/_info.php");
            echo "</select></td></tr>\n";
            echo "<tr><td colspan=\"2\" align=\"right\"><input type=\"submit\" value=\"";
            echo $GLOBALS["messages"]["btnlogin"] . "\"></td></tr>\n</form></table><br>\n";
            ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	if(document.login) document.login.p_user.focus();
// -->
</script><?php 
            show_footer();
            exit;
        }
    }
}
开发者ID:Caojunkai,项目名称:arcticfox,代码行数:46,代码来源:login.php

示例8: upload_items

function upload_items($dir)
{
    _debug("fun_up_ajaxupload.upload_items({$dir})");
    if (!permissions_grant($dir, NULL, "create")) {
        show_error($GLOBALS["error_msg"]["accessfunc"]);
    }
    if (isset($GLOBALS['__POST']["confirm"]) && $GLOBALS['__POST']["confirm"] == "true") {
        _debug("linking to list({$dir})");
        header("Location: " . make_link("list", $dir, NULL));
        return;
    }
    global $no_access;
    $additional_header_information = file_get_contents("_lib/ajaxupload/upload.html");
    $additional_header_information = preg_replace("/@destination_folder@/", $dir, $additional_header_information);
    $additional_header_information = preg_replace("/@filter_pattern@/", "/{$no_access}/", $additional_header_information);
    show_header($GLOBALS["messages"]["actupload"], $additional_header_information);
    ?>

<br>
	<div id="example1" class="example">
		<div class="wrapper">
			<div id="button1" class="button">Upload</div>
		</div>
		<ol class="status"></ol>
		<p>Uploaded files:</p>
		<ol class="files"></ol>
	</div>
    <table>
            <tr>
                <td>
                    <input type="button" onClick="window.location = '<?php 
    echo make_link("list", $dir, NULL);
    ?>
';" value="<?php 
    echo $GLOBALS["error_msg"]["back"];
    ?>
">
                </td>
            </tr>
        </table>
    </form>
    <br>
<?php 
    return;
}
开发者ID:gilshwartz,项目名称:quixplorer,代码行数:45,代码来源:fun_up_ajaxupload.php

示例9: show_msg

function show_msg($message, $url_forward = '')
{
    global $_iGLOBAL;
    obclean();
    if ($url_forward) {
        $_iGLOBAL['extrahead'] = '<meta http-equiv="refresh" content="100; url=' . $url_forward . '">';
        $message = "<a href=\"{$url_forward}\">{$message}(跳转中...)</a>";
    } else {
        $_iGLOBAL['extrahead'] = '';
    }
    show_header();
    print <<<END
\t<table>
\t<tr><td>{$message}</td></tr>
\t</table>
END;
    show_footer();
    exit;
}
开发者ID:idreamsoft,项目名称:iCMS5.0,代码行数:19,代码来源:update.php

示例10: show_msg

function show_msg($message, $url_forward = '')
{
    global $_SGLOBAL;
    obclean();
    $_SGLOBAL['extrahead'] = $url_forward ? '<meta http-equiv="refresh" content="0; url=' . $url_forward . '">' : '';
    show_header();
    print <<<END
\t<table>
\t<tr><td>{$message}</td></tr>
\t</table>
END;
    show_footer();
    exit;
}
开发者ID:v998,项目名称:discuzx-en,代码行数:14,代码来源:convert.php

示例11: edit_file

function edit_file($dir, $item)
{
    // edit file
    if (($GLOBALS["permissions"] & 01) != 01) {
        show_error($GLOBALS["error_msg"]["accessfunc"]);
    }
    if (!get_is_file($dir, $item)) {
        show_error($item . ": " . $GLOBALS["error_msg"]["fileexist"]);
    }
    if (!get_show_item($dir, $item)) {
        show_error($item . ": " . $GLOBALS["error_msg"]["accessfile"]);
    }
    $fname = get_abs_item($dir, $item);
    if (isset($GLOBALS['__POST']["dosave"]) && $GLOBALS['__POST']["dosave"] == "yes") {
        // Save / Save As
        $item = base_name(stripslashes($GLOBALS['__POST']["fname"]));
        $fname2 = get_abs_item($dir, $item);
        if (!isset($item) || $item == "") {
            show_error($GLOBALS["error_msg"]["miscnoname"]);
        }
        if ($fname != $fname2 && @file_exists($fname2)) {
            show_error($item . ": " . $GLOBALS["error_msg"]["itemdoesexist"]);
        }
        savefile($fname2);
        $fname = $fname2;
    }
    // open file
    $fp = @fopen($fname, "r");
    if ($fp === false) {
        show_error($item . ": " . $GLOBALS["error_msg"]["openfile"]);
    }
    // header
    $s_item = get_rel_item($dir, $item);
    if (strlen($s_item) > 50) {
        $s_item = "..." . substr($s_item, -47);
    }
    show_header($GLOBALS["messages"]["actedit"] . ": /" . $s_item);
    // Wordwrap (works only in IE)
    ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	function chwrap() {
		if(document.editfrm.wrap.checked) {
			document.editfrm.code.wrap="soft";
		} else {
			document.editfrm.code.wrap="off";
		}
	}
// -->
</script><?php 
    // Form
    echo "<BR><FORM name=\"editfrm\" method=\"post\" action=\"" . make_link("edit", $dir, $item) . "\">\n";
    echo "<input type=\"hidden\" name=\"dosave\" value=\"yes\">\n";
    echo "<TEXTAREA NAME=\"code\" rows=\"25\" cols=\"120\" wrap=\"off\">";
    // Show File In TextArea
    $buffer = "";
    while (!feof($fp)) {
        $buffer .= fgets($fp, 4096);
    }
    @fclose($fp);
    echo htmlspecialchars($buffer);
    echo "</TEXTAREA><BR>\n<TABLE><TR><TD>Wordwrap: (IE only)</TD><TD><INPUT type=\"checkbox\" name=\"wrap\" ";
    echo "onClick=\"javascript:chwrap();\" value=\"1\"></TD></TR></TABLE><BR>\n";
    echo "<TABLE><TR><TD><INPUT type=\"text\" name=\"fname\" value=\"" . $item . "\"></TD>";
    echo "<TD><input type=\"submit\" value=\"" . $GLOBALS["messages"]["btnsave"];
    echo "\"></TD>\n<TD><input type=\"reset\" value=\"" . $GLOBALS["messages"]["btnreset"] . "\"></TD>\n<TD>";
    echo "<input type=\"button\" value=\"" . $GLOBALS["messages"]["btnclose"] . "\" onClick=\"javascript:location='";
    echo make_link("list", $dir, NULL) . "';\"></TD></TR></FORM></TABLE><BR>\n";
    ?>
<script language="JavaScript1.2" type="text/javascript">
<!--
	if(document.editfrm) document.editfrm.code.focus();
// -->
</script><?php 
}
开发者ID:ZenaVault,项目名称:FreeNAS-Source,代码行数:75,代码来源:fun_edit.php

示例12: session_start

<?php

session_start();
require_once '../config.php';
require_once '../database.php';
require_once '../ui.php';
show_header('../');
show_menu('../');
#Authentication:
if (!isset($_SESSION['admin'])) {
    if (!isset($_POST['pwd'])) {
        include 'login.php';
    } else {
        $user = list_users('admin');
        print_r($user);
        print_r($_POST);
        if ($user['upassword'] == $_POST['pwd']) {
            $_SESSION['admin'] = 'yes';
            print 'Access granted.';
        } else {
            print 'Wrong password!';
        }
    }
}
if (isset($_SESSION['admin'])) {
    $devices = list_secrets();
    $settings = list_settings();
    show_settings($settings);
    show_devices($devices);
}
include '../html_footer.html';
开发者ID:ways,项目名称:BigBrotherGPSweb,代码行数:31,代码来源:index.php

示例13: login_page

function login_page()
{
    show_header();
    $formhash = thash();
    print <<<END
\t\t<span>工具箱登录</span>
\t\t<form action="tools.php?action=login" method="post">
\t\t\t<table class="specialtable">
\t\t\t<tr>
\t\t\t\t<td width="20%"><input class="textinput" type="password" name="toolpassword"></input></td>
\t\t\t\t<td><input class="specialsubmit" type="submit" value="登 录"></input></td>
\t\t\t</tr>
\t\t\t</table>
\t\t\t<input type="hidden" name="action" value="login">
\t\t\t<input type="hidden" name="formhash" value="{$formhash}">
\t\t</form>
END;
    show_footer();
}
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:19,代码来源:tools.php

示例14: show_header

	$DB->query("SELECT Name, Description, UserID, Deleted FROM collages WHERE ID='$CollageID'");
	if($DB->record_count() > 0) {
		list($Name, $Description, $UserID, $Deleted) = $DB->next_record();
		$TorrentList='';
		$CollageList='';
	} else {
		$Deleted = '1';
	}
}

if($Deleted == '1') {
	header('Location: log.php?search=Collage+'.$CollageID);
	die();
}

show_header($Name,'browse,collage');
show_message();
// Build the data for the collage and the torrent list

if(!is_array($TorrentList)) {
	$DB->query("SELECT ct.GroupID,
			tg.WikiImage,
			tg.CategoryID,
			um.ID,
			um.Username
			FROM collages_torrents AS ct
			JOIN torrents_group AS tg ON tg.ID=ct.GroupID
			LEFT JOIN users_main AS um ON um.ID=ct.UserID
			WHERE ct.CollageID='$CollageID'
			ORDER BY ct.Sort");
	
开发者ID:4play,项目名称:gazelle2,代码行数:30,代码来源:collage.php

示例15: explode

if (isset($_GET['ip']) && isset($_GET['port'])) {
    $Octets = explode(".", $_GET['ip']);
    if (empty($_GET['ip']) || !preg_match('/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}/', $_GET['ip']) || $Octets[0] < 0 || $Octets[0] > 255 || $Octets[1] < 0 || $Octets[1] > 255 || $Octets[2] < 0 || $Octets[2] > 255 || $Octets[3] < 0 || $Octets[3] > 255 || $Octets[0] == 127 || $Octets[0] == 192) {
        die('Invalid IP');
    }
    if (empty($_GET['port']) || !is_number($_GET['port']) || $_GET['port'] < 1 || $_GET['port'] > 65535) {
        die('Invalid Port');
    }
    //Error suppression, ugh.
    if (@fsockopen($_GET['ip'], $_GET['port'], $Errno, $Errstr, 20)) {
        die('Port ' . $_GET['port'] . ' on ' . $_GET['ip'] . ' connected successfully.');
    } else {
        die('Port ' . $_GET['port'] . ' on ' . $_GET['ip'] . ' failed to connect.');
    }
}
show_header('Connectability Checker');
?>
<div class="thin">
	<h2><a href="user.php?id=<?php 
echo $LoggedUser['ID'];
?>
"><?php 
echo $LoggedUser['Username'];
?>
</a> &gt; Connectability Checker</h2>
	<form action="javascript:check_ip();" method="get">
		<table>
			<tr>
				<td class="label">IP</td>
				<td>
					<input type="text" id="ip" name="ip" value="<?php 
开发者ID:morilo,项目名称:ptpimg,代码行数:31,代码来源:connchecker.php


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