本文整理汇总了PHP中Visitor::getIP方法的典型用法代码示例。如果您正苦于以下问题:PHP Visitor::getIP方法的具体用法?PHP Visitor::getIP怎么用?PHP Visitor::getIP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Visitor
的用法示例。
在下文中一共展示了Visitor::getIP方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Account
//create / set pass to admin account
$account = new Account(1, Account::LOADTYPE_NAME);
if ($account->isLoaded()) {
$account->setPassword($newpass);
// setPassword encrypt it to ots encryption
$account->setPageAccess(3);
$account->setFlag('unknown');
$account->save();
} else {
$newAccount = new Account();
$newAccount->setName(1);
$newAccount->setPassword($newpass);
// setPassword encrypt it to ots encryption
$newAccount->setMail(rand(0, 999999) . '@gmail.com');
$newAccount->setPageAccess(3);
$newAccount->setGroupID(1);
$newAccount->setFlag('unknown');
$newAccount->setCreateIP(Visitor::getIP());
$newAccount->setCreateDate(time());
}
$_SESSION['account'] = 1;
$_SESSION['password'] = $newpass;
$logged = TRUE;
echo '<h1>Admin account login: 1<br>Admin account password: ' . $newpass . '</h1><br/><h3>It\'s end of installation. Installation is blocked!</h3>';
if (!unlink('install.txt')) {
new Error_Critic('', 'Cannot remove file <i>install.txt</i>. You must remove it to disable installer. I recommend you to go to step <i>0</i> and check if any other file got problems with WRITE permission.');
}
}
}
}
}
示例2: htmlspecialchars
$char_to_copy->setLookType(136);
}
$char_to_copy->setID(null);
// save as new character
$char_to_copy->setLastIP(0);
$char_to_copy->setLastLogin(0);
$char_to_copy->setLastLogout(0);
$char_to_copy->setName($newchar_name);
$char_to_copy->setAccount($account_logged);
$char_to_copy->setSex($newchar_sex);
$char_to_copy->setTown($newchar_town);
$char_to_copy->setPosX(0);
$char_to_copy->setPosY(0);
$char_to_copy->setPosZ(0);
$char_to_copy->setWorldID((int) $world_id);
$char_to_copy->setCreateIP(Visitor::getIP());
$char_to_copy->setCreateDate(time());
$char_to_copy->setSave();
// make character saveable
$char_to_copy->save();
// now it will load 'id' of new player
if ($char_to_copy->isLoaded()) {
$char_to_copy->saveItems();
$char_to_copy->saveSkills();
$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url(' . $layout_name . '/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Character Created</div> <span class="CaptionVerticalRight" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url(' . $layout_name . '/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>The character <b>' . htmlspecialchars($newchar_name) . '</b> has been created.<br/>Please select the outfit when you log in for the first time.<br/><br/><b>See you on ' . $config['server']['servername'] . '!</b></td></tr> </table> </div> </table></div></td></tr><br/><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url(' . $layout_name . '/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url(' . $layout_name . '/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="' . $layout_name . '/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></center>';
} else {
echo "Error. Can\\'t create character. Probably problem with database. Try again or contact with admin.";
exit;
}
} else {
$main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url(' . $layout_name . '/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url(' . $layout_name . '/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url(' . $layout_name . '/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url(' . $layout_name . '/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
示例3: mt_rand
if (empty($reg_form_errors)) {
//create object 'account' and generate new acc. number
if ($config['site']['create_account_verify_mail']) {
$reg_password = '';
for ($i = 1; $i <= 6; $i++) {
$reg_password .= mt_rand(0, 9);
}
}
$reg_account = new Account();
// saves account information in database
$reg_account->setName($reg_name);
$reg_account->setPassword($reg_password);
$reg_account->setEMail($reg_email);
$reg_account->setCreateDate(time());
$reg_account->setCreateIP(Visitor::getIP());
$reg_account->setFlag(Website::getCountryCode(long2ip(Visitor::getIP())));
if (isset($config['site']['newaccount_premdays']) && $config['site']['newaccount_premdays'] > 0) {
$reg_account->set("premdays", $config['site']['newaccount_premdays']);
$reg_account->set("lastday", time());
}
$reg_account->save();
//show information about registration
if ($config['site']['send_emails'] && $config['site']['create_account_verify_mail']) {
$mailBody = '<html>
<body>
<h3>Your account name and password!</h3>
<p>You or someone else registred on server <a href="' . $config['server']['url'] . '"><b>' . htmlspecialchars($config['server']['serverName']) . '</b></a> with this e-mail.</p>
<p>Account name: <b>' . htmlspecialchars($reg_name) . '</b></p>
<p>Password: <b>' . htmlspecialchars(trim($reg_password)) . '</b></p>
<br />
<p>After login you can:</p>