本文整理汇总了PHP中SmrMySqlDatabase::escapeNumber方法的典型用法代码示例。如果您正苦于以下问题:PHP SmrMySqlDatabase::escapeNumber方法的具体用法?PHP SmrMySqlDatabase::escapeNumber怎么用?PHP SmrMySqlDatabase::escapeNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmrMySqlDatabase
的用法示例。
在下文中一共展示了SmrMySqlDatabase::escapeNumber方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: channel_join
function channel_join($fp, $rdata)
{
if (preg_match('/^:(.*)!(.*)@(.*)\\sJOIN\\s:(.*)\\s$/i', $rdata, $msg)) {
$nick = $msg[1];
$user = $msg[2];
$host = $msg[3];
$channel = $msg[4];
echo_r('[JOIN] ' . $nick . '!' . $user . '@' . $host . ' joined ' . $channel);
// if ($nick == 'MrSpock' && $user == 'mrspock')
// fputs($fp, 'PRIVMSG ' . $channel . ' :The creator! The God! He\'s among us! Praise him!' . EOL);
if ($nick == 'Holti' && $user == 'Holti') {
fputs($fp, 'PRIVMSG ' . $channel . ' :' . chr(1) . 'ACTION hands ' . $nick . ' a ' . chr(3) . '4@' . chr(3) . '3' . chr(2) . '}' . chr(2) . '-,`--' . chr(1) . EOL);
}
if ($nick == 'kiNky' && $user == 'cicika') {
fputs($fp, 'PRIVMSG ' . $channel . ' :' . chr(1) . 'ACTION hands ' . $nick . ' a ' . chr(3) . '4@' . chr(3) . '3' . chr(2) . '}' . chr(2) . '-,`--' . chr(1) . EOL);
}
if ($nick == 'River' && $user == 'Serenity') {
fputs($fp, 'PRIVMSG ' . $channel . ' :' . chr(1) . 'ACTION hands ' . $nick . ' a ' . chr(3) . '8@' . chr(3) . '3' . chr(2) . '}' . chr(2) . '-,`--' . chr(1) . EOL);
}
$db = new SmrMySqlDatabase();
// check if we have seen this user before
$db->query('SELECT * FROM irc_seen WHERE nick = ' . $db->escapeString($nick) . ' AND channel = ' . $db->escapeString($channel));
if ($db->nextRecord()) {
// exiting nick?
$seen_id = $db->getField('seen_id');
$seen_count = $db->getField('seen_count');
$seen_by = $db->getField('seen_by');
if ($seen_count > 1) {
fputs($fp, 'PRIVMSG ' . $channel . ' :Welcome back ' . $nick . '. While being away ' . $seen_count . ' players were looking for you, the last one being ' . $seen_by . EOL);
} elseif ($seen_count > 0) {
fputs($fp, 'PRIVMSG ' . $channel . ' :Welcome back ' . $nick . '. While being away ' . $seen_by . ' was looking for you.' . EOL);
}
$db->query('UPDATE irc_seen
SET signed_on = ' . $db->escapeNumber(time()) . ',
signed_off = 0,
user = ' . $db->escapeString($user) . ',
host = ' . $db->escapeString($host) . ',
seen_count = 0,
seen_by = NULL,
registered = NULL
WHERE seen_id = ' . $db->escapeNumber($seen_id));
} else {
// new nick?
$db->query('INSERT INTO irc_seen (nick, user, host, channel, signed_on) VALUES(' . $db->escapeString($nick) . ', ' . $db->escapeString($user) . ', ' . $db->escapeString($host) . ', ' . $db->escapeString($channel) . ', ' . time() . ')');
}
// check if player joined alliance chat
channel_op_notification($fp, $rdata, $nick, $channel);
return true;
}
return false;
}
示例2: channel_msg_seedlist_add
function channel_msg_seedlist_add($fp, $rdata, $account, $player)
{
if (preg_match('/^:(.*)!(.*)@(.*)\\sPRIVMSG\\s(.*)\\s:!seedlist add (.*)\\s$/i', $rdata, $msg)) {
$nick = $msg[1];
$user = $msg[2];
$host = $msg[3];
$channel = $msg[4];
$sectors = explode(' ', $msg[5]);
echo_r('[SEEDLIST_ADD] by ' . $nick . ' in ' . $channel);
// check if $nick is leader
if (!$player->isAllianceLeader(true)) {
fputs($fp, 'PRIVMSG ' . $channel . ' :' . $nick . ', only the leader of the alliance manages the seedlist.' . EOL);
return true;
}
foreach ($sectors as $sector) {
// see if the sector is numeric
if (!is_numeric($sector)) {
fputs($fp, 'PRIVMSG ' . $channel . ' :The sectors all need to be numeric. Example: !seedlist add 1537' . EOL);
return true;
}
}
$db = new SmrMySqlDatabase();
foreach ($sectors as $sector) {
// check if the sector is a part of the game
$db->query('SELECT sector_id
FROM sector
WHERE game_id = ' . $player->getGameID() . '
AND sector_id = ' . $db->escapeNumber($sector));
if (!$db->nextRecord()) {
fputs($fp, 'PRIVMSG ' . $channel . ' :The sector ' . $sector . ' does not exist in current game.' . EOL);
continue;
}
// check if the given sector is already part of the seed list
$db->query('SELECT sector_id
FROM alliance_has_seedlist
WHERE alliance_id = ' . $player->getAllianceID() . '
AND game_id = ' . $player->getGameID() . '
AND sector_id = ' . $db->escapeNumber($sector));
if ($db->nextRecord()) {
// fputs($fp, 'PRIVMSG ' . $channel . ' :The sector ' . $sector . ' is already in the seedlist.' . EOL);
continue;
}
// add sector to db
$db->query('INSERT INTO alliance_has_seedlist
(alliance_id, game_id, sector_id)
VALUES (' . $player->getAllianceID() . ', ' . $player->getGameID() . ', ' . $db->escapeNumber($sector) . ')');
// fputs($fp, 'PRIVMSG ' . $channel . ' :The sector ' . $sector . ' has been added.' . EOL);
}
fputs($fp, 'PRIVMSG ' . $channel . ' :The sectors have been added.' . EOL);
return true;
}
return false;
}
示例3: array
$container['type'] = 'alliance';
$PHP_OUTPUT .= create_echo_form($container);
//count of messages
$count = 0;
//array for mb so we dont duplicate
$mb_msgs = array();
while ($db->nextRecord()) {
//search every message on webboards for each word first
$id = $db->getField('id');
$word = $db->getField('keyword');
$db2->query('SELECT * FROM alliance_thread WHERE sender_id != 0 AND text LIKE ' . $db2->escapeString('%' . $word . '%') . ' ORDER BY time DESC');
while ($db2->nextRecord()) {
//assume we arent skipping
$skip = 'no';
$bad = $db2->getField('text');
$db3->query('SELECT * FROM mb_keywords WHERE assoc = ' . $db3->escapeNumber($id) . ' AND type = \'ignore\' AND `use` = 1');
while ($db3->nextRecord()) {
$word2 = $db3->getField('keyword');
$db4->query('SELECT ' . $db->escapeString($bad) . ' LIKE ' . $db4->escapeString('%' . $word2 . '%'));
$db4->nextRecord();
if ($db4->getField(0)) {
$skip = 'yes';
}
}
if ($skip == 'yes') {
continue;
}
//get info
$game_id = $db2->getField('game_id');
$alliance_id = $db2->getField('alliance_id');
$thread_id = $db2->getField('thread_id');
示例4: while
WHERE account_id = 1
AND game_id = ' . $db->escapeNumber($var['game_id']));
if ($db->nextRecord()) {
$PHP_OUTPUT .= '<option value="0">[please select]</option>';
// get all accounts
$db->query('SELECT account_id, login
FROM account
ORDER BY login');
while ($db->nextRecord()) {
// get current account id and login
$curr_account_id = $db->getInt('account_id');
$curr_login = $db->getField('login');
// check if this guy is already in
$db2->query('SELECT player_name
FROM player
WHERE account_id = ' . $db2->escapeNumber($curr_account_id) . '
AND game_id = ' . $db2->escapeNumber($var['game_id']));
if (!$db2->nextRecord()) {
$PHP_OUTPUT .= '<option value="' . $curr_account_id . '">' . $curr_login . '</option>';
}
}
} else {
$PHP_OUTPUT .= '<option value="1">MrSpock</option>';
$player_name = 'MrSpock';
$readonly = ' readonly';
}
$PHP_OUTPUT .= '</select><br /><br /><br />';
$PHP_OUTPUT .= 'Player Name:<br /><br />';
$PHP_OUTPUT .= '<input type="text" name="player_name" value="' . $player_name . '" id="InputFields" style="padding-left:10px;"' . $readonly . '><br /><br /><br />';
$PHP_OUTPUT .= 'Player Race:<br /><br />';
$PHP_OUTPUT .= '<select name="race_id" id="InputFields" style="padding-left:10px;">';
示例5: SmrMySqlDatabase
$PHP_OUTPUT .= '<p>Here are the rankings of the races by their experience</p>';
$PHP_OUTPUT .= '<table class="standard" width="95%">';
$PHP_OUTPUT .= '<tr>';
$PHP_OUTPUT .= '<th>Rank</th>';
$PHP_OUTPUT .= '<th>Race</th>';
$PHP_OUTPUT .= '<th>Total Experience</th>';
$PHP_OUTPUT .= '<th>Average Experience</th>';
$PHP_OUTPUT .= '<th>Total Traders</th>';
$PHP_OUTPUT .= '</tr>';
$rank = 0;
$db2 = new SmrMySqlDatabase();
$db->query('SELECT race_id, race_name, SUM(experience) as experience_sum, COUNT(*) as members FROM player JOIN race USING(race_id) WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' GROUP BY race_id ORDER BY experience_sum DESC');
while ($db->nextRecord()) {
$rank++;
$race_id = $db->getInt('race_id');
$db2->query('SELECT * FROM player WHERE race_id = ' . $db2->escapeNumber($race_id) . ' AND game_id = ' . $db2->escapeNumber($player->getGameID()) . ' AND out_of_game = \'TRUE\'');
if ($player->getRaceID() == $race_id) {
$style = ' class="bold"';
} elseif ($db2->nextRecord()) {
$style = ' class="red"';
} else {
$style = '';
}
// if ($db2->nextRecord()) $style .=
$PHP_OUTPUT .= '<tr>';
$PHP_OUTPUT .= '<td align="center"' . $style . '>' . $rank . '</td>';
$PHP_OUTPUT .= '<td align="center"' . $style . '>' . $db->getField('race_name') . '</td>';
$PHP_OUTPUT .= '<td align="center"' . $style . '>' . $db->getInt('experience_sum') . '</td>';
$PHP_OUTPUT .= '<td align="center"' . $style . '>' . round($db->getInt('experience_sum') / $db->getInt('members')) . '</td>';
$PHP_OUTPUT .= '<td align="center"' . $style . '>' . $db->getInt('members') . '</td>';
$PHP_OUTPUT .= '</tr>';
示例6: array
LIMIT 1');
if ($db->getNumRows() || $player->isOnCouncil()) {
$db->query('SELECT * FROM message_type
ORDER BY message_type_id');
} else {
$db->query('SELECT * FROM message_type
WHERE message_type_id != ' . $db->escapeNumber(MSG_POLITICAL) . '
ORDER BY message_type_id');
}
$messageBoxes = array();
while ($db->nextRecord()) {
$message_type_id = $db->getField('message_type_id');
$messageBox['Name'] = $db->getField('message_type_name');
// do we have unread msges in that folder?
$db2->query('SELECT 1 FROM message
WHERE account_id = ' . $db2->escapeNumber($player->getAccountID()) . '
AND game_id = ' . $db2->escapeNumber($player->getGameID()) . '
AND message_type_id = ' . $db2->escapeNumber($message_type_id) . '
AND msg_read = ' . $db2->escapeBoolean(false) . '
AND receiver_delete = ' . $db2->escapeBoolean(false) . ' LIMIT 1');
$messageBox['HasUnread'] = $db2->getNumRows() != 0;
$messageBox['MessageCount'] = 0;
// get number of msges
$db2->query('SELECT count(message_id) as message_count FROM message
WHERE account_id = ' . $db2->escapeNumber($player->getAccountID()) . '
AND game_id = ' . $db2->escapeNumber($player->getGameID()) . '
AND message_type_id = ' . $db2->escapeNumber($message_type_id) . '
AND receiver_delete = ' . $db2->escapeBoolean(false));
if ($db2->nextRecord()) {
$messageBox['MessageCount'] = $db2->getField('message_count');
}
示例7: array
<?php
$template->assign('PageTopic', 'Log Console');
$loggedAccounts = array();
$db->query('SELECT account_id as account_id, login, count(*) as number_of_entries
FROM account_has_logs
JOIN account USING(account_id)
GROUP BY account_id');
if ($db->getNumRows()) {
$db2 = new SmrMySqlDatabase();
while ($db->nextRecord()) {
$accountID = $db->getInt('account_id');
$loggedAccounts[$accountID] = array('AccountID' => $accountID, 'Login' => $db->getField('login'), 'TotalEntries' => $db->getInt('number_of_entries'), 'Checked' => is_array($var['account_ids']) && in_array($accountID, $var['account_ids']), 'Notes' => '');
$db2->query('SELECT notes FROM log_has_notes WHERE account_id = ' . $db2->escapeNumber($accountID));
if ($db2->nextRecord()) {
$loggedAccounts[$accountID]['Notes'] = nl2br($db2->getField('notes'));
}
}
// put hidden fields in for log type to have all fields selected on next page.
$logTypes = array();
$db->query('SELECT log_type_id FROM log_type');
while ($db->nextRecord()) {
$logTypes[] = $db->getInt('log_type_id');
}
$template->assignByRef('LogTypes', $logTypes);
$template->assign('LogConsoleFormHREF', SmrSession::getNewHREF(create_container('skeleton.php', 'log_console_detail.php')));
$template->assign('AnonAccessHRE', SmrSession::getNewHREF(create_container('skeleton.php', 'log_anonymous_account.php')));
}
$template->assignByRef('LoggedAccounts', $loggedAccounts);
示例8: forward
$container['account_id'] = $album_id;
forward($container);
exit;
}
$db = new SmrMySqlDatabase();
if (!isset($_GET['comment']) || empty($_GET['comment'])) {
create_error_offline('Please enter a comment.');
} else {
$comment = $_GET['comment'];
}
// get current time
$curr_time = TIME;
$comment = word_filter($comment);
$account->sendMessageToBox(BOX_ALBUM_COMMENTS, $comment);
// check if we have comments for this album already
$db->lockTable('album_has_comments');
$db->query('SELECT MAX(comment_id) FROM album_has_comments WHERE album_id = ' . $db->escapeNumber($album_id));
if ($db->nextRecord()) {
$comment_id = $db->getField('MAX(comment_id)') + 1;
} else {
$comment_id = 1;
}
$db->query('INSERT INTO album_has_comments
(album_id, comment_id, time, post_id, msg)
VALUES (' . $db->escapeNumber($album_id) . ', ' . $db->escapeNumber($comment_id) . ', ' . $db->escapeNumber($curr_time) . ', ' . $db->escapeNumber($account->getAccountID()) . ', ' . $db->escapeString($comment) . ')');
$db->unlock();
header('Location: ' . URL . '/album/?' . get_album_nick($album_id));
exit;
} catch (Exception $e) {
handleException($e);
}
示例9: array
<?php
$container = array();
$container['url'] = 'skeleton.php';
$container['body'] = 'message_blacklist.php';
if (!isset($_REQUEST['PlayerName']) && !isset($var['account_id'])) {
$container['error'] = 1;
forward($container);
exit;
}
if (isset($var['account_id'])) {
$blacklisted_id = $var['account_id'];
} else {
$player_name = mysql_real_escape_string($_REQUEST['PlayerName']);
$db = new SmrMySqlDatabase();
$db->query('SELECT account_id FROM player WHERE player_name=' . $db->escapeString($player_name) . ' AND game_id=' . $db->escapeNumber($player->getGameID()) . ' LIMIT 1');
if (!$db->nextRecord()) {
$container['error'] = 1;
forward($container);
exit;
}
$blacklisted_id = $db->getField('account_id');
}
$db->query('SELECT account_id FROM message_blacklist WHERE account_id=' . $db->escapeNumber($player->getAccountID()) . ' AND blacklisted_id=' . $db->escapeNumber($blacklisted_id) . ' AND game_id=' . $db->escapeNumber($player->getGameID()) . ' LIMIT 1');
if ($db->nextRecord()) {
$container['error'] = 2;
forward($container);
exit;
}
$db->query('INSERT INTO message_blacklist (game_id,account_id,blacklisted_id) VALUES (' . $db->escapeNumber($player->getGameID()) . ',' . $db->escapeNumber($player->getAccountID()) . ',' . $db->escapeNumber($blacklisted_id) . ')');
$container['error'] = 3;
示例10: IN
$container['item'] = 'sector_id';
$PHP_OUTPUT .= create_link($container, '<th style="cursor:hand;">Sector</th>');
$PHP_OUTPUT .= '<th>Message</th>';
$PHP_OUTPUT .= '</tr>';
$db->query('SELECT * FROM account_has_logs WHERE account_id IN (' . $account_list . ') AND log_type_id IN (' . $db->escapeArray($log_type_id_list) . ') ORDER BY ' . $var['item'] . ' ' . $var['order']);
while ($db->nextRecord()) {
$account_id = $db->getInt('account_id');
$microtime = $db->getMicrotime('microtime');
$message = stripslashes($db->getField('message'));
$log_type_id = $db->getInt('log_type_id');
$sector_id = $db->getInt('sector_id');
// generate style string
$style = ' style="color:' . $colors[$account_id] . ';"';
$PHP_OUTPUT .= '<tr>';
$PHP_OUTPUT .= '<td' . $style . '>' . date(DATE_FULL_SHORT, microtimeSec($microtime)) . ' ' . microtimeMSec($microtime) . 'us</td>';
$db2->query('SELECT * FROM log_type WHERE log_type_id = ' . $db2->escapeNumber($log_type_id));
if ($db2->nextRecord()) {
$PHP_OUTPUT .= '<td align="center"' . $style . '>' . $db2->getField('log_type_entry') . '</td>';
} else {
$PHP_OUTPUT .= '<td align="center"' . $style . '>unknown</td>';
}
$PHP_OUTPUT .= '<td align="center"' . $style . '>' . $sector_id . '</td>';
$PHP_OUTPUT .= '<td' . $style . '>' . $message . '</td>';
$PHP_OUTPUT .= '</tr>';
}
$PHP_OUTPUT .= '</table>';
}
$PHP_OUTPUT .= '<p>';
$container = create_container('skeleton.php', 'log_console.php');
$container['account_ids'] = $account_ids;
$PHP_OUTPUT .= create_link($container, '<b>< Back</b>');
示例11: SmrMySqlDatabase
<?php
/*
http://www.smrealms.de/sms/response.php?message_id=%message_id%&message=%message%&from=%from%&ref=%ref%
%message_id% Message ID of text that is being responded to
%message% text of response
%from% cell number of responder
%ref% reference
*/
include '../config.inc';
include LIB . 'Default/SmrMySqlDatabase.class.inc';
include ENGINE . '/Default/smr.inc';
// database object
$db = new SmrMySqlDatabase();
// get input
$message_id = (int) $_GET['message_id'];
$message = $_GET['message'];
$from = $_GET['from'];
// add dlr to database
$db->query('INSERT INTO account_sms_response ' . '(message_id, message, from) ' . 'VALUES (' . $db->escapeNumber($message_id) . ', ' . $db->escapeString($message) . ', ' . $db->escapeString($from) . ')');
示例12: strtolower
$PHP_OUTPUT .= '<p> </p>';
$PHP_OUTPUT .= '<p>';
while ($db->nextRecord()) {
if ($anon_id != $db->getField('anon_id')) {
// if this is not the first entry we have to close previous list
if ($anon_id > 0) {
$PHP_OUTPUT .= '</ul>';
}
// set current anon_id
$anon_id = $db->getInt('anon_id');
// start topic for it
$PHP_OUTPUT .= 'Account #' . $anon_id;
$PHP_OUTPUT .= '<ul>';
}
$curr_account =& SmrAccount::getAccount($db->getInt('account_id'));
$transaction_id = $db->getInt('transaction_id');
$db2->query('SELECT * FROM anon_bank_transactions
WHERE account_id = ' . $db2->escapeNumber($curr_account->getAccountID()) . ' AND
anon_id = ' . $db2->escapeNumber($anon_id) . ' AND
transaction_id = ' . $db2->escapeNumber($transaction_id));
if ($db2->nextRecord()) {
$text = strtolower($db2->getField('transaction')) . ' ' . number_format($db2->getInt('amount')) . ' credits';
}
$PHP_OUTPUT .= '<li>' . $curr_account->getLogin() . ' ' . $text . '</li>';
}
$PHP_OUTPUT .= '</ul>';
$PHP_OUTPUT .= '</p>';
$PHP_OUTPUT .= '<p> </p>';
$PHP_OUTPUT .= '<p>';
$PHP_OUTPUT .= create_link(create_container('skeleton.php', 'log_console.php'), '<b>< Back</b>');
$PHP_OUTPUT .= '</p>';
示例13: SmrMySqlDatabase
$PHP_OUTPUT .= '<big>Here are the updates that have gone live since your last visit, enjoy!</big><br/><br/>';
}
$db2 = new SmrMySqlDatabase();
$db->query('SELECT *
FROM version
WHERE went_live > ' . (isset($var['Since']) ? $db->escapeNumber($var['Since']) : '0') . '
ORDER BY version_id DESC');
while ($db->nextRecord()) {
$version_id = $db->getInt('version_id');
$version = $db->getInt('major_version') . '.' . $db->getInt('minor_version') . '.' . $db->getInt('patch_level');
$went_live = $db->getInt('went_live');
// get human readable format for date
if ($went_live > 0) {
$went_live = date(DATE_FULL_SHORT, $went_live);
} else {
$went_live = 'never';
}
$PHP_OUTPUT .= '<b><small>' . $version . ' (' . $went_live . '):</small></b>';
$PHP_OUTPUT .= '<ul>';
$db2->query('SELECT *
FROM changelog
WHERE version_id = ' . $db2->escapeNumber($version_id) . '
ORDER BY changelog_id');
while ($db2->nextRecord()) {
$PHP_OUTPUT .= '<li>' . $db2->getField('change_title') . '<br /><small>' . $db2->getField('change_message') . '</small></li>';
}
$PHP_OUTPUT .= '</ul><br />';
if (isset($var['Since'])) {
$PHP_OUTPUT .= create_button(create_container('logged_in.php'), 'Continue');
}
}
示例14:
}
$db->query('SELECT * FROM account WHERE account_id >= ' . $db->escapeNumber($start) . ' AND account_id <= ' . $db->escapeNumber($end) . ' ORDER BY account_id');
$PHP_OUTPUT .= create_table();
$PHP_OUTPUT .= '<tr>';
$PHP_OUTPUT .= '<th align=center>Account_id</th>';
$PHP_OUTPUT .= '<th align=center>Login</th>';
$PHP_OUTPUT .= '<th align=center>eMail</th>';
$PHP_OUTPUT .= '<th align=center>Last IP</th>';
$PHP_OUTPUT .= '<th align=center>Exception</th>';
$PHP_OUTPUT .= '</tr>';
while ($db->nextRecord()) {
$acc_id = $db->getField('account_id');
$PHP_OUTPUT .= '<tr>';
$PHP_OUTPUT .= '<td align=center>' . $acc_id . '</td>';
$PHP_OUTPUT .= '<td align=center>' . $db->getField('login') . '</td>';
$PHP_OUTPUT .= '<td align=center>' . $db->getField('email') . '</td>';
$db2->query('SELECT * FROM account_has_ip WHERE account_id = ' . $db2->escapeNumber($acc_id) . ' ORDER BY time DESC LIMIT 1');
if ($db2->nextRecord()) {
$PHP_OUTPUT .= '<td align=center>' . $db2->getField('ip') . '</td>';
} else {
$PHP_OUTPUT .= '<td align=center>No Last IP</td>';
}
$db2->query('SELECT * FROM account_exceptions WHERE account_id = ' . $db2->escapeNumber($acc_id));
if ($db2->nextRecord()) {
$PHP_OUTPUT .= '<td align=center>' . $db2->getField('reason') . '</td>';
} else {
$PHP_OUTPUT .= '<td align=center>No Exception</td>';
}
$PHP_OUTPUT .= '</tr>';
}
$PHP_OUTPUT .= '</table>';
示例15: catch
try {
$account =& SmrAccount::createAccount($login, $password, $email, $first_name, $last_name, $address, $city, $postal_code, $country_code, $icq, $timez, $referral);
} catch (Exception $e) {
$msg = 'Invalid referral id!';
header('Location: ' . URL . '/error.php?msg=' . rawurlencode(htmlspecialchars($msg, ENT_QUOTES)));
exit;
}
$account->increaseSmrRewardCredits(2 * CREDITS_PER_DOLLAR);
// Give $2 worth of "reward" credits for joining.
if ($socialLogin) {
$account->addAuthMethod($_SESSION['socialLogin']->getLoginType(), $_SESSION['socialLogin']->getUserID());
$account->setValidated(true);
session_destroy();
}
// register session
SmrSession::$account_id = $account->getAccountID();
// save ip
$account->updateIP();
// send email with validation code to user
mail($email, 'New Space Merchant Realms User', 'Your validation code is: ' . $account->getValidationCode() . EOL . 'The Space Merchant Realms server is on the web at ' . URL . '/' . EOL . 'Please verify within the next 7 days or your account will be automatically deleted.', 'From: support@smrealms.de');
// remember when we sent validation code
$db->query('INSERT INTO notification (notification_type, account_id, time) ' . 'VALUES(\'validation_code\', ' . $db->escapeNumber(SmrSession::$account_id) . ', ' . $db->escapeNumber(TIME) . ')');
// insert into the account stats table
$db->query('INSERT INTO account_has_stats (account_id, HoF_name) VALUES(' . $db->escapeNumber(SmrSession::$account_id) . ', ' . $db->escape_string($account->getLogin()) . ')');
$container = create_container('login_processing2.php');
$container['login'] = $login;
$container['password'] = $password;
forwardURL($container);
} catch (Exception $e) {
handleException($e);
}