本文整理匯總了PHP中type::post方法的典型用法代碼示例。如果您正苦於以下問題:PHP type::post方法的具體用法?PHP type::post怎麽用?PHP type::post使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類type
的用法示例。
在下文中一共展示了type::post方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loginPost
protected static function loginPost()
{
$email = type::post('email', 'string');
$password = type::post('password', 'string');
// Formular ganz abgesendet?
if (is_null($email) || is_null($password) || $email == '' || $password == '') {
echo message::info(lang::get('login_form_notfull'), true);
return;
}
$sql = sql::factory();
$sql->query('SELECT password, id FROM ' . sql::table('user') . ' WHERE `email` = "' . $sql->escape($email) . '"');
// Username mit E-Mail vorhanden?
if (!$sql->num()) {
echo message::danger(sprintf(lang::get('login_no_user'), $email), true);
return;
}
$sql->result();
// Password nicht gleich?
if (!self::checkPassword($password, $sql->get('password'))) {
echo message::danger(lang::get('login_pwd_false'), true);
return;
}
self::loginSession();
self::$userID = $sql->get('id');
$_SESSION['login'] = $sql->get('id') . '||' . self::hash($password);
}
示例2: loginPost
protected static function loginPost()
{
$email = type::post('email', 'string');
$password = type::post('password', 'string');
$remember = type::post('remember', 'int');
if (is_null($email) || is_null($password) || $email == '' || $password == '') {
echo message::info(lang::get('fill_out_both'));
return;
}
$sql = new sql();
$sql->query('SELECT password, salt, id FROM ' . sql::table('user') . ' WHERE `email` = "' . $sql->escape($email) . '"');
if (!$sql->num()) {
echo message::danger(sprintf(lang::get('email_not_found'), htmlspecialchars($email)), true);
$shake = 1;
return;
}
$sql->result();
if (!self::checkPassword($password, $sql->get('salt'), $sql->get('password'))) {
echo message::danger(lang::get('wrong_pw'));
$shake = 1;
return;
}
self::loginSession();
self::$userID = $sql->get('id');
$_SESSION['login'] = $sql->get('id');
if ($remember) {
setcookie("remember", $sql->get('id'), time() + 3600 * 24 * 7);
}
}
示例3: addToSql
public function addToSql($sql)
{
$array = type::post('DYN_' . $this->DynType, 'array', []);
foreach ($array as $key => $count) {
if ($count > $this->counts) {
continue;
}
$sqlName = $this->getSqlPrefix($type, $this->dynVars[2][$key]);
$sql->addPost($sqlName, $this->dynVars[0][$key]);
}
return $sql;
}
示例4: BackendAjax
protected static function BackendAjax()
{
$sort = type::post('array', 'array');
$sql = sql::factory();
$sql->setTable('metainfos');
foreach ($sort as $s => $id) {
$sql->setWhere('id=' . $id);
$sql->addPost('sort', $s + 1);
$sql->update();
}
ajax::addReturn(message::success(lang::get('save_sorting'), true));
}
示例5: saveBlock
public static function saveBlock()
{
$id = type::post('id', 'int');
$sql = sql::factory();
$sql->setTable('blocks');
foreach (pageArea::$types as $class) {
$class = new $class();
$sql = $class->addSaveValues($sql);
}
$sql->setWhere('id=' . $id);
$sql->update();
}
示例6: saveBlock
public static function saveBlock()
{
$id = type::post('id', 'int');
$sql = sql::factory();
$sql->setTable('structure_area');
$sql->getPosts(['online' => 'int', 'modul' => 'int', 'structure_id' => 'int', 'sort' => 'int']);
foreach (pageArea::$types as $class) {
$class = new $class();
$sql = $class->addSaveValues($sql);
}
if ($id) {
$sql->setWhere('id=' . $id);
$sql->update();
} else {
$sql->save();
}
self::saveSortUp($sql->getPost('structure_id'), $sql->getPost('sort'));
}
示例7: loginPost
protected static function loginPost()
{
$email = type::post('email', 'string');
$password = type::post('password', 'string');
// Formular ganz abgesendet?
if (is_null($email) || is_null($password) || $email == '' || $password == '') {
echo message::info(lang::get('login_form_notfull'), true);
return;
}
$sql = sql::factory();
$sql->query('SELECT password, salt, id FROM ' . sql::table('user') . ' WHERE `email` = "' . $sql->escape($email) . '"');
// Username mit E-Mail vorhanden?
if (!$sql->num()) {
echo message::danger(sprintf(lang::get('login_no_user'), htmlspecialchars($email)), true);
return;
}
$sql->result();
// Password nicht gleich?
if (!self::checkPassword($password, $sql->get('salt'), $sql->get('password'))) {
echo message::danger(lang::get('login_pwd_false'), true);
return;
}
self::loginSession();
self::$userID = $sql->get('id');
$_SESSION['login'] = $sql->get('id');
// Falls alte Methode (sha1) neuen Salt generieren und salt updaten
// sha1 deprecated 0.2 Beta
$salt = $sql->get('salt');
if (empty($salt)) {
$salt = self::generateSalt();
$sql->setTable('user');
$sql->setWhere('`email` = "' . $email . '"');
$sql->addPost('salt', $salt);
$sql->addPost('password', self::hash($password, $salt));
$sql->update();
}
}
示例8: checkLogin
public static function checkLogin()
{
$username = type::post('username', 'string', '');
$password = type::post('password', 'string', '');
if ($username == '' || $password == '') {
echo message::info(lang::get('login_form_notfull'), true);
return;
}
$sql = sql::factory();
$sql->query('SELECT password, salt, id FROM ' . sql::table('community_user') . ' WHERE `username` = "' . $sql->escape($username) . '"');
if (!$sql->num()) {
echo message::danger(sprintf(lang::get('login_no_user'), $email), true);
return;
}
$sql->result();
if (!userLogin::checkPassword($password, $sql->get('salt'), $sql->get('password'))) {
echo message::danger(lang::get('login_pwd_false'), true);
return;
}
$_SESSION['community-login'] = $sql->get('id');
self::checkSession();
// Für spätere Foren-Bridges
extension::get('COMMUNITY_USER_LOGIN', $password);
}
示例9: getPosts
public function getPosts($post)
{
if (!is_array($post)) {
//throw new Exception();
}
foreach ($post as $val => $cast) {
$this->values[$val] = $this->escape(type::post($val, $cast, ''));
}
return $this;
}
示例10:
<div class="row">
<?php
// Wenn Aktion == add
// UND Wenn Sortierung von SQL gleich der $_GET['sort']
// UND Wenn Formular noch nicht abgeschickt worden
if ($action == 'add' && $sort == $i && !$form->isSubmit()) {
echo pageAreaHtml::formOut($form);
} else {
echo pageAreaHtml::selectBlock($module->getStructureId());
}
// Wenn Aktion == edit
// UND Wenn ID von SQL gleich der $_GET['id']
// UND
// Wenn Formular noch nicht abgeschickt worden
// ODER Abgeschickt worden ist und ein Übernehmen geklickt worden ist
if ($action == 'edit' && $id == $sql->get('id') && (!$form->isSubmit() || $form->isSubmit() && !is_null(type::post('save-back')))) {
echo pageAreaHtml::formOut($form);
} else {
if ($sql->get('online')) {
$class = 'online fa fa-check';
} else {
$class = 'offline fa fa-times';
}
$button = ['<a href="' . url::backend('structure', ['subpage' => 'pages', 'structure_id' => $structure_id, 'action' => 'online', 'id' => $sql->get('id')]) . '" class="btn btn-sm dyn-' . $class . '"></a>', '<a href="' . url::backend('structure', ['subpage' => 'pages', 'structure_id' => $structure_id, 'action' => 'edit', 'id' => $sql->get('id')]) . '" class="btn btn-default btn-sm fa fa-edit"></a>', '<a href="' . url::backend('structure', ['subpage' => 'pages', 'structure_id' => $structure_id, 'action' => 'delete', 'id' => $sql->get('id')]) . '" class="btn btn-danger btn-sm fa fa-trash-o delete"></a>'];
echo bootstrap::panel($sql->get('name'), $button, $module->OutputFilter($sql->get('output'), $sql));
}
?>
</div>
</li>
<?php
$sql->next();
示例11:
<div class="col-sm-8">
<input type="text" name="database" value="<?php
echo type::post('database');
?>
">
</div>
</div>
<div class="input row">
<label class="col-sm-4"><?php
echo lang::get('prefix');
?>
</label>
<div class="col-sm-8">
<input type="text" name="prefix" value="<?php
echo type::post('prefix');
?>
">
</div>
</div>
<hr>
<a href="?page=lang" class="button light nospace pull-left"><?php
echo lang::get('back');
?>
</a>
<button type="submit" class="nospace pull-right"><?php
echo lang::get('save');
?>
示例12:
?>
" value="<?php
echo type::post('email');
?>
">
<input type="password" name="password" placeholder="<?php
echo lang::get('password');
?>
">
<div class="foot">
<div class="switch">
<input name="remember" id="remember" value="1" type="checkbox" <?php
echo type::post('remember', 'int') ? 'checked="checked"' : '';
?>
>
<label for="remember"></label>
<div><?php
echo lang::get('remember_login');
?>
</div>
</div>
<button name="login" type="submit">
<?php
echo layout::svg('check');
?>
</button>
示例13: foreach
$title = lang::get('module_add');
}
if ($form->isSubmit()) {
pageCache::clearAll();
}
$back = '<a class="btn btn-sm btn-default" href="' . url::backend('structure', ['subpage' => 'module']) . '">' . lang::get('back') . '</a>';
?>
<div class="row"><?php
echo bootstrap::panel($title, [$button, $back], $form->show());
?>
</div>
<?php
}
if ($action == '') {
if (ajax::is()) {
$sort = type::post('array', 'array');
$sql = sql::factory();
$sql->setTable('module');
foreach ($sort as $s => $id) {
$sql->setWhere('id=' . $id);
$sql->addPost('sort', $s + 1);
$sql->update();
}
ajax::addReturn(message::success(lang::get('save_sorting'), true));
}
$table = table::factory(['class' => ['js-sort']]);
$table->addCollsLayout('20,*,110');
$table->addRow()->addCell()->addCell(lang::get('name'))->addCell(lang::get('action'));
$table->addSection('tbody');
$table->setSql('SELECT * FROM ' . sql::table('module') . ' ORDER BY sort ');
if ($table->numSql()) {
示例14: pageArea
<?php
$secondpage = type::super('secondpage', 'string');
if (!is_null($secondpage) && dyn::get('user')->hasPerm('page[content]')) {
if (!is_null(type::post('save-back')) || !is_null(type::post('save'))) {
slot::saveBlock();
echo message::success(lang::get('structure_content_save'), true);
}
if ($secondpage == 'show') {
$sql = sql::factory();
$sql->query('
SELECT
s.*, m.output
FROM
' . sql::table('slots') . ' AS s
LEFT JOIN
' . sql::table('module') . ' AS m
ON m.id = s.modul
WHERE s.id=' . $id)->result();
$pageArea = new pageArea($sql);
$form = form::factory('module', 'id=' . $sql->get('modul'), 'index.php');
$form->setSave(false);
$form->addFormAttribute('class', '');
$form->setSuccessMessage(null);
$input = $pageArea->OutputFilter($form->get('input'), $sql);
$form->addRawField($input);
$form->addHiddenField('secondpage', $secondpage);
$form->addHiddenField('id', $id);
?>
<div class="row">
<div class="col-lg-12">
示例15: foreach
<?php
$catId = type::super('catId', 'int', 0);
$subaction = type::super('subaction', 'string');
if ($action == 'delete' && dyn::get('user')->hasPerm('media[delete]')) {
echo mediaUtils::deleteFile($id);
$action = '';
}
if ($action == 'deleteFiles') {
$files = type::post('file', '', []);
foreach ($files as $id) {
echo mediaUtils::deleteFile($id);
}
$action = '';
}
if (in_array($action, ['add', 'edit']) && dyn::get('user')->hasPerm('media[edit]')) {
$form = form::factory('media', 'id=' . $id, 'index.php');
$form->addFormAttribute('enctype', 'multipart/form-data');
$field = $form->addTextField('title', $form->get('title'));
$field->fieldName(lang::get('title'));
$field->autofocus();
$category = type::session('media_cat', 'int', $form->get('category'));
$field = $form->addRawField('<select class="form-control" name="category">' . mediaUtils::getTreeStructure(0, 0, ' ', $category) . '</select>');
$field->fieldName(lang::get('category'));
$field = $form->addRawField('<input type="file" name="file" />');
$field->fieldName(lang::get('select_file'));
if ($action == 'edit') {
$form->addHiddenField('id', $id);
}
if ($form->isSubmit()) {
type::addSession('media_cat', $form->get('category'));