本文整理汇总了PHP中_post函数的典型用法代码示例。如果您正苦于以下问题:PHP _post函数的具体用法?PHP _post怎么用?PHP _post使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_post函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _sendmail
/**
* send mail
*/
function _sendmail($cp)
{
//$mail->SMTPDebug = 3; // Enable verbose debug output
$to = $cp->email_domain ? $cp->email_domain : ADMIN_EMAIL;
$res = send_mail1($to, _post('subject'), _post('body'));
ajax_output(strip_tags($res));
}
示例2: saveBanner
function saveBanner()
{
$banID = _post("banID");
$url = _post("url");
$link = _post("link");
$text = _post("text");
$param = _post("param");
$isactive = _post("isactive");
$fParts = split("\\.", $url);
//echo '<hr><pre>'; print_r($fParts);echo '</pre><hr>';
if (count($fParts) == 1) {
$type = $fParts[0];
} else {
$type = $fParts[1];
}
if (!$banID) {
$query = "INSERT INTO pm_banners (`url`, `type`, `link`,`text` ,`param`, `isactive`) \n\t\t\tVALUES ('" . $url . "', '" . $type . "', '" . $link . "', '" . $text . "', '" . $param . "', '" . $isactive . "')\n\t\t\t";
} else {
$query = "UPDATE pm_banners SET \n\t\t\t\t`url` = '" . $url . "',\n\t\t\t\t`type` = '" . $type . "',\n\t\t\t\t`link` = '" . $link . "',\n\t\t\t\t`text` = '" . $text . "',\n\t\t\t\t`isactive` = '" . $isactive . "',\n\t\t\t\t`param` = '" . $param . "'\n\t\t\tWHERE banID = '" . $banID . "'";
}
//echo $query;
if (!mysql_query($query)) {
trigger_error("Error while updating banner [{$query}] - " . mysql_error(), PM_FATAL);
}
header("Location: /admin?cmd=banner");
}
示例3: saveVote
function saveVote()
{
$qID = _post("qID");
$Question = _post("Question");
$Ans1 = _post("Ans1");
$Ans2 = _post("Ans2");
$Ans3 = _post("Ans3");
$Ans4 = _post("Ans4");
$Ans5 = _post("Ans5");
$Ans6 = _post("Ans6");
$Ans7 = _post("Ans7");
$Ans8 = _post("Ans8");
$Ans9 = _post("Ans9");
$Ans10 = _post("Ans10");
$isactive = _post("isactive");
$isdefault = _post("isdefault");
if (!$qID) {
$query = "INSERT INTO pm_vote (`Question`, `Ans1`, `Ans2`, `Ans3`, `Ans4`, `Ans5`, `Ans6`, `Ans7`, `Ans8`, `Ans9`, `Ans10`, `isdefault`, `isactive`) \n\t\t\tVALUES ('" . $Question . "', '" . $Ans1 . "', '" . $Ans2 . "', '" . $Ans3 . "', '" . $Ans4 . "', '" . $Ans5 . "', '" . $Ans6 . "', '" . $Ans7 . "', '" . $Ans8 . "', '" . $Ans9 . "', '" . $Ans10 . "', '" . $isdefault . "', '" . $isactive . "')\n\t\t\t";
} else {
$query = "UPDATE pm_vote SET \n\t\t\t\t`Question` = '" . $Question . "',\n\t\t\t\t`Ans1` = '" . $Ans1 . "',\n\t\t\t\t`Ans2` = '" . $Ans2 . "',\n\t\t\t\t`Ans3` = '" . $Ans3 . "',\n\t\t\t\t`Ans4` = '" . $Ans4 . "',\n\t\t\t\t`Ans5` = '" . $Ans5 . "',\n\t\t\t\t`Ans6` = '" . $Ans6 . "',\n\t\t\t\t`Ans7` = '" . $Ans7 . "',\n\t\t\t\t`Ans8` = '" . $Ans8 . "',\n\t\t\t\t`Ans9` = '" . $Ans9 . "',\n\t\t\t\t`Ans10` = '" . $Ans10 . "',\n\t\t\t\t`isdefault` = '" . $isdefault . "',\n\t\t\t\t`isactive` = '" . $isactive . "'\n\t\t\tWHERE qID = '" . $qID . "'";
}
//echo $query;
if (!mysql_query($query)) {
trigger_error("Error while updating vote [{$query}] - " . mysql_error(), PM_FATAL);
}
header("Location: /admin?cmd=vote");
}
示例4: updateFromRequest
function updateFromRequest()
{
parent::updateFromRequest();
$category = _post("fld_category");
$categoryLbl = _post("fld_category_lbl");
$item = _post("fld_item");
$itemLbl = _post("fld_item_lbl");
$completed = _post("fld_completed");
$frequency = _post("fld_frequency");
$frequencyComparator = _post("fld_frequency_comparator");
$this->completed = $completed == 'yes';
$this->frequency = $frequency;
$this->frequencyComparator = $frequencyComparator;
// update labels
// xxx todo abstract this out to a manager (which may or may not defer to core options handling code)!
// xxx this belongs more in the rule manager
$dbLbl = getLabel($category, 'rule_action_category');
if ($category && $dbLbl != $categoryLbl) {
// update
sqlStatement("UPDATE list_options SET title = ? WHERE list_id = 'rule_action_category' AND option_id = ?", array($categoryLbl, $category));
}
$dbLbl = getLabel($item, 'rule_action');
if ($item && $dbLbl != $itemLbl) {
// update
sqlStatement("UPDATE list_options SET title = ? WHERE list_id = 'rule_action' AND option_id = ?", array($itemLbl, $item));
}
$this->category = $category;
$this->item = $item;
$this->itemLbl = $itemLbl;
$this->categoryLbl = $categoryLbl;
}
示例5: fromPost
/**
* Return all post parameters or a single post parameter.
*
* @param string|null $param
* Parameter name to retrieve, or null to get all.
* @param mixed $default
* Default value to use when the parameter is missing.
* @return mixed
*/
public function fromPost($param = null, $default = null)
{
$result = _post($param);
if (null === $result && null !== $default) {
$result = $default;
}
return $result;
/*
if (null === $this->postParams) {
$request = $this->getController()->getRequest();
if ($request->getHeaders('accept')->match('application/json')) {
$content = $request->getContent();
$this->postParams = json_decode($content, true);
} else {
$this->postParams = parent::fromPost(null, $default);
}
}
if ($param === null) {
return $this->postParams;
} else {
return isset($this->postParams[$param])
? $this->postParams[$param] : $default;
}
*/
}
示例6: authenticate
function authenticate()
{
$q = "SELECT userID FROM pm_users WHERE login=\"" . mysql_escape_string(_post('login')) . "\" AND Password = \"" . mysql_escape_string(md5(_post('psw'))) . "\" AND uDeleted=0 AND isUserGroup=0";
$qr = mysql_query($q);
if (!$qr) {
trigger_error("Invaild query while reading user info - " . mysql_error(), PM_FATAL);
}
$count = mysql_num_rows($qr);
if ($count == 1) {
list($userID) = mysql_fetch_row($qr);
if ($userID) {
// trigger_error("Auth userID: $userID", PM_WARNING);
$sessionID = _cookie("sessionID");
// trigger_error("Auth sessionID: $sessionID", PM_WARNING);
if (!$sessionID) {
$sessionID = $this->generateSessionID();
}
setcookie("sessionID", $sessionID, time() + 30 * 24 * 60 * 60, "/");
//expire in a month
mysql_query("REPLACE INTO pm_sessions (sessionID, userID, CreateTime) VALUES(\"{$sessionID}\", {$userID}, NOW())");
mysql_query("UPDATE pm_users SET LoginDate=NOW() WHERE userID={$userID}");
$this->userID = $userID;
return true;
}
}
return false;
}
示例7: updateFromRequest
function updateFromRequest()
{
parent::updateFromRequest();
$age = _post("fld_value");
$timeUnit = TimeUnit::from(_post("fld_timeunit"));
$this->value = $age;
$this->timeUnit = $timeUnit;
}
示例8: updateFromRequest
function updateFromRequest()
{
parent::updateFromRequest();
$value = _post("fld_value");
$exploded = explode(" ", $value);
$diagInfo = explode(":", $exploded[0]);
$this->codeType = $diagInfo[0];
$this->id = $diagInfo[1];
}
示例9: edit_teacher_POST
function edit_teacher_POST($id)
{
$description = _post('description');
$teacher = new Teacher($id);
if ($description) {
$teacher->update('description', $description);
}
redirect("teacher/{$id}/edit");
}
示例10: have_access
/**
* Check view and edit permissions.
*
* @param $op
* The type of operation. Either 'view' or 'edit'.
*/
function have_access($op)
{
global $user;
$db = DBConnection::instance();
$field_id = (int) _post('fid');
if (!$field_id) {
$field_id = (int) _get('fid');
}
$field = (object) $db->dq("SELECT entity_id, entity_type, delta FROM {mytinytodo_fields} WHERE id = ?", $field_id)->fetch_assoc();
$field_info = field_info_field_by_id($field->delta);
if ($field->entity_type == 'node') {
if (!($node = node_load($field->entity_id))) {
return false;
}
$node_access = $op == 'edit' ? 'update' : $op;
if (node_access($node_access, $node, $user) && field_access($op, $field_info, $field->entity_type, $node, $user)) {
return true;
}
} else {
if ($field->entity_type == 'user') {
if (!($account = user_load($field->entity_id))) {
return false;
}
if (field_access($op, $field_info, $field->entity_type, $account, $user)) {
return true;
}
} else {
if ($field->entity_type == 'comment') {
if (!($comment = comment_load($field->entity_id))) {
return false;
}
if ($op == 'view' && !user_access('access comments')) {
return false;
} else {
if ($op == 'edit' && !comment_access($op, $comment)) {
return false;
}
}
if (field_access($op, $field_info, $field->entity_type, $comment, $user)) {
return true;
}
} else {
if (module_exists('entity')) {
if (!($entity = entity_load($field_id))) {
return false;
}
$entity_access = $op == 'edit' ? 'update' : $op;
if (entity_access($entity_access, $field->entity_type, $entity, $user) && field_access($op, $field_info, $field->entity_type, $entity, $user)) {
return true;
}
}
}
}
}
return false;
}
示例11: updateFromRequest
function updateFromRequest()
{
parent::updateFromRequest();
$this->table = _post("fld_table");
$this->column = _post("fld_column");
$this->value = _post("fld_value");
$this->valueComparator = _post("fld_value_comparator");
$this->frequency = _post("fld_frequency");
$this->frequencyComparator = _post("fld_frequency_comparator");
}
示例12: _check_csrf
private function _check_csrf()
{
if (!_is_post()) {
return;
}
if (_post('form_key') !== Session::form_key()) {
Log::write(chr(27) . '[41m' . chr(27) . '[37m** POSSIBLE CSRF **' . chr(27) . '[0m');
Errors::show_404();
}
}
示例13: acc_number
public static function acc_number()
{
$zones = _post('zones');
$routes = _post('routes');
$category = _post('category');
$array = array($zones, $routes, $category);
//$acc_no = implode( $array);
$acc_no = var_dump(implode('Ksm', array()));
// The modified acc_no.
return $acc_no;
}
示例14: updateFromRequest
function updateFromRequest()
{
parent::updateFromRequest();
$age = _post("fld_value");
$timeUnit = TimeUnit::from(_post("fld_timeunit"));
if ($timeUnit == null) {
$timeUnit = TimeUnit::from(_post("fld_target_interval_type"));
}
$this->value = $age;
$this->timeUnit = $timeUnit;
}
示例15: add_course_POST
function add_course_POST()
{
$name = _post('name');
$teacher = _post('teacher');
$description = _post('description');
if ($name && $teacher) {
$course = Course::create(compact('name', 'teacher', 'description'));
redirect('course/' . $course->id);
} else {
show_form();
}
}