本文整理匯總了PHP中util::getPost方法的典型用法代碼示例。如果您正苦於以下問題:PHP util::getPost方法的具體用法?PHP util::getPost怎麽用?PHP util::getPost使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類util
的用法示例。
在下文中一共展示了util::getPost方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: showLogin
$output = showLogin("", isset($_SESSION[Challenge::PLAYER]));
//$output[] = "You are logged in";
if (isset($_SESSION['referrer'])) {
$location = util::getSession('referrer');
unset($_SESSION['referrer']);
header("Location:" . $location);
}
} else {
$output = showLogin("Unknown user", isset($_SESSION[Challenge::PLAYER]));
}
break;
case 'doregister':
$output = showRegister('');
break;
case 'register':
if (util::getPost('password1') === false) {
$output = showRegister('');
} else {
extract($_POST);
// print_r($_POST);
if ("" == $email) {
// echo "setting email";
$email = "";
}
if (!"" == $name) {
if ($password1 != $password2) {
// not all set
$output = showRegister("Passwords not equal");
} else {
if (CTF::register($name, $password1, $email)) {
$output = showLogin("", isset($_SESSION[Challenge::PLAYER]));
示例2: session_start
<?php
session_start();
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
require_once "../config/config.inc.php";
$challenge = new Challenge();
if (isset($_POST['m'])) {
$mail = util::getPost('m');
$db = new MySQL(HOST, DB_USER, DB_PASSWORD, DB_NAME);
$sql = "SELECT mfrom,mto,msubject,mbody,mdate FROM mailbox m,players u WHERE u.id=m.userid AND u.name='" . $challenge->getUser() . "' AND m.mailid={$mail}";
// echo $sql;
$result = $db->query($sql);
$row = $result->fetch();
extract($row);
$text = <<<EOT
<div id="message">
<!-- mail starts here -->
<table id="mailheader" cellpadding="15" cellspacing="3">
<tr><td align="right">To:</td><td> </td><td>{$mto}</td></tr>
<tr><td align="right">From:</td><td> </td><td>{$mfrom}</td></tr>
<tr><td align="right">Date:</td><td> </td><td>{$mdate}</td></tr>
<tr><td align="right">Subject:</td><td> </td><td>{$msubject}</td></tr>
</table>
<hr/>
<div id="mailbody">{$mbody}</div>
<!-- mail ends here -->
</div>
EOT;
示例3: Challenge
<?php
require_once '../../../../config/config.inc.php';
$challenge = new Challenge();
$challenge->startChallenge();
$pwd = $challenge->getDictionaryWord();
$token = $challenge->getToken();
$user = "admin";
$sessionhack = base64_encode($user . "/" . $pwd);
if (isset($_POST['submit'])) {
$code = util::getPost('password');
if ($code == $pwd) {
$challenge->mark();
CTF::showAchieved();
}
}
?>
<br/><br/><applet code="Applet1.class" height=60><param name="session" value="<?php
echo $sessionhack;
?>
" /></applet>
<hr/>
<form autocomplete="off" method="post">
<input type="hidden" name="action" value="login" />
<table>
<tr><td>Code</td><td>:</td><td><input type="text" name="password" /></td></tr>
<tr><td colspan=2/><td><input type="submit" class="button" name="submit" value="Submit" /></td></tr>
</table>
</form>
示例4: MySQL
echo CTF::header($array);
echo '<div id="challengecontainer"><div id="challengeframe">';
$output = "";
$db = new MySQL(HOST, DB_USER, DB_PASSWORD, DB_NAME);
if (isset($_SESSION['player'])) {
if (isset($_GET['t'])) {
$t = util::getGet('t');
$token = $challenge->getToken();
echo "t={$t};token={$token}";
if (true === ($t == $token)) {
$challenge->mark();
util::forward(WEBROOT . "/index.php");
}
} else {
if (isset($_POST['action'])) {
$token = util::getPost('token');
$validtoken = $challenge->getToken();
if ($validToken === $token || in_array($token, $otherTokens)) {
$output = "valid token";
// token is valid
//$row = $result->fetch();
$user = util::getSession('player');
$sql = "INSERT INTO scoreboard SELECT id,'{$token}',now()+0 FROM players WHERE name='{$user}'";
//$sql = "INSERT INTO scoreboard VALUES($user,'$token',now()+1)";
$result = $db->query($sql);
} else {
$output = "not valid";
}
}
}
} else {