本文整理汇总了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();
示例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);