當前位置: 首頁>>代碼示例>>PHP>>正文


PHP headers::userdata方法代碼示例

本文整理匯總了PHP中headers::userdata方法的典型用法代碼示例。如果您正苦於以下問題:PHP headers::userdata方法的具體用法?PHP headers::userdata怎麽用?PHP headers::userdata使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在headers的用法示例。


在下文中一共展示了headers::userdata方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: header

along with this program; if not, write to the Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
session_start();
require "global_func.php";
if ($_SESSION['loggedin'] == 0) {
    header("Location: login.php");
    exit;
}
$userid = $_SESSION['userid'];
require "header.php";
$h = new headers();
$h->startheaders();
include "mysql.php";
global $c;
$is = mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$userid}", $c) or die(mysql_error());
$ir = mysql_fetch_array($is);
check_level();
$fm = money_formatter($ir['money']);
$cm = money_formatter($ir['crystals'], '');
$lv = date('F j, Y, g:i a', $ir['laston']);
$h->userdata($ir, $lv, $fm, $cm);
$h->menuarea();
$_GET['ID'] = abs((int) $_GET['ID']);
if (!$_GET['ID']) {
    die("Incorrect usage of file.");
}
$q = mysql_query("SELECT * FROM oclogs WHERE oclID={$_GET['ID']}", $c);
$r = mysql_fetch_array($q);
print "Here is the detailed view on this crime.<br />\n<b>Crime:</b> {$r['ocCRIMEN']}<br />\n<b>Time Executed:</b> " . date('F j, Y, g:i:s a', $r['ocTIME']) . "<br />\n                {$r['oclLOG']}<br /><br />\n<b>Result:</b> {$r['oclRESULT']}<br />\n<b>Money Made:</b> \${$r['oclMONEY']}";
$h->endpage();
開發者ID:jwest00724,項目名稱:mccodefree,代碼行數:31,代碼來源:oclog.php

示例2: die

if ($_SESSION['userid']) {
    if ($guest) {
        $gutxt = " AND guest=1";
    }
    $is = $db->query("SELECT * FROM users WHERE userid='{$userid}'{$gutxt}");
    $useex = $db->num_rows($is);
    if ($useex > 0) {
        $ir = $db->fetch_row($is);
        $namenospaces = str_replace(" ", "_", $ir['username']);
        $_SESSION['username'] = $namenospaces;
    } else {
        if (!$userid) {
            die('error');
        } else {
            if ($guest == 1) {
                header('Location: login.php');
            } else {
                $name = $user->fbc_name;
                $db->query("INSERT INTO users (userid, username, money) VALUES('{$userid}', '{$name}', 1000)");
                $is = $db->query("SELECT * FROM users WHERE userid='{$userid}'");
                $ir = $db->fetch_row($is);
            }
        }
    }
}
$h = new headers();
$h->startheaders();
$fm = "\$" . number_format($ir['money']);
$lv = date('F j, Y, g:i a', $ir['laston']);
$h->userdata($ir, $lv, $fm);
開發者ID:marcfeather,項目名稱:Multiplayer-PHP-Ajax-Games,代碼行數:30,代碼來源:globals.php


注:本文中的headers::userdata方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。