本文整理汇总了PHP中check_form函数的典型用法代码示例。如果您正苦于以下问题:PHP check_form函数的具体用法?PHP check_form怎么用?PHP check_form使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_form函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateConfirm
function generateConfirm($edit)
{
$dataInvalid = $this->isDataInvalid($edit);
if ($this->formbuilder) {
$this->formbuilder->bulk_set_answers($_POST[$this->event->formkey()]);
$dataInvalid .= $this->formbuilder->answers_invalid();
}
if ($dataInvalid) {
error_exit($dataInvalid . '<br>Please use your back button to return to the form, fix these errors, and try again.');
}
$output = para('Please confirm that this data is correct and click the submit button to proceed to the payment information page.');
$output .= form_hidden('edit[step]', 'submit');
$fields = array('Registration Status' => 'payment', 'Notes' => 'notes');
$rows = array();
foreach ($fields as $display => $column) {
array_push($rows, array($display, form_hidden("edit[{$column}]", $edit[$column]) . check_form($edit[$column])));
}
$output .= form_group('Registration details', "<div class='pairtable'>" . table(null, $rows) . '</div>');
if ($this->formbuilder) {
$form = $this->formbuilder->render_viewable();
$form .= $this->formbuilder->render_hidden();
$output .= form_group('Registration answers', $form);
}
$output .= para(form_submit('submit'));
return form($output);
}
示例2: check_form
function check_form(&$value, &$error_array, $exempt_array = array(), $key = NULL)
{
$collect_error_array = array();
$index = 0;
// display ( $exempt_array ) ;
// display ( $value ) ;
foreach ($value as $array_key => $array_value) {
if (is_array($array_value)) {
// echo "Is ARRAY<BR>\n" ;
check_form($array_value, $error_array, &$exempt_array, &$array_key);
} else {
$vars = trim($array_value);
if ($key === NULL) {
// echo "Non array <br>\n" ;
if (isset($array_key) && $vars != "") {
validate($array_key, $vars, &$collect_error_array, &$index);
// If the value is valid
} else {
if (!in_array($array_key, $exempt_array)) {
// echo "Error \$key: " . $array_key . " \$value: " . $array_value . " <br>\n" ;
$collect_error_array[$index] = " This entry cannot be empty.<br>\n";
}
}
} else {
if (isset($array_key) && $vars != "") {
// echo "ARRAY key passed <br>\n" ;
validate($key, $vars, &$collect_error_array, &$index, &$array_key);
// If the value is valid
} else {
if (!in_array($key, $exempt_array)) {
// echo "Error \$key: " . $key . " \$value: " . $array_value . " <br>\n" ;
$collect_error_array[$index] = " This entry cannot be empty.<br>\n";
}
}
}
}
if ($key === NULL) {
$index = 0;
if (count($collect_error_array) > 0) {
// echo "Upper error<br>\n" ;
$error_array[$array_key] = $collect_error_array;
$collect_error_array = array();
}
} else {
$index++;
}
}
if ($key !== NULL) {
if (count($collect_error_array) > 0) {
// echo "ARRAY error<br>\n" ;
$error_array[$key] = $collect_error_array;
}
}
}
示例3: smarty_hidden_fields
function smarty_hidden_fields($params, &$smarty)
{
if (empty($params['group'])) {
$params['group'] = 'edit';
}
$output = '';
if (array_key_exists('fields', $params) && !empty($params['fields'])) {
foreach ($params['fields'] as $name => $value) {
$output .= "<input type=\"hidden\" name=\"{$params['group']}[{$name}]\" value=\"" . check_form($value) . "\" />\n";
}
}
return $output;
}
示例4: process
function process()
{
global $lr_session;
# Nuke HTML just in case
$team_name = check_form($this->team->name, ENT_NOQUOTES);
$this->title = "{$team_name} » Move";
$edit = $_POST['edit'];
if ($edit['step']) {
if ($edit['target'] < 1) {
error_exit("That is not a valid league to move to");
}
if (!$lr_session->has_permission('league', 'manage teams', $edit['target'])) {
error_exit("Sorry, you cannot move teams to leagues you do not coordinate");
}
$targetleague = League::load(array('league_id' => $edit['target']));
if (!$targetleague) {
error_exit("You must supply a valid league to move to");
}
if ($targetleague->league_id == $this->team->league_id) {
error_exit("You can't move a team to the league it's currently in!");
}
}
if ($edit['swaptarget']) {
$target_team = Team::load(array('team_id' => $edit['swaptarget']));
if (!$target_team) {
error_exit("You must supply a valid target team ID");
}
if ($target_team->league_id == $this->team->league_id) {
error_exit("You can't swap with a team that's already in the same league!");
}
if ($target_team->league_id != $targetleague->league_id) {
error_exit("You can't swap with a team that's not in the league you want to move to!");
}
if (!$lr_session->has_permission('league', 'manage teams', $target_team->league_id)) {
error_exit("Sorry, you cannot move teams to leagues you do not coordinate");
}
}
switch ($edit['step']) {
case 'perform':
$sourceleague = League::load(array('league_id' => $this->team->league_id));
$this->perform($targetleague, $target_team);
local_redirect(url("league/view/" . $sourceleague->league_id));
case 'confirm':
return $this->confirm($targetleague, $target_team);
case 'swaptarget':
return $this->choose_swaptarget($targetleague);
default:
return $this->choose_league();
}
error_exit("Error: This code should never be reached.");
}
示例5: form_reset
function form_reset($value, $name = "reset")
{
return "<input type=\"reset\" name=\"{$name}\" value=\"" . check_form($value) . "\" />\n";
}
示例6: int
if (!empty($_POST['server_name']) && !empty($_POST['user_name']) && !empty($_POST['password']) && !empty($_POST['database'])) {
global $server_name;
$server_name = $_POST['server_name'];
global $user_name;
$user_name = $_POST['user_name'];
global $password;
$password = $_POST['password'];
global $database;
$database = $_POST['database'];
return true;
} else {
echo "Заполните все поля";
}
}
}
if (check_form()) {
$db = DbSimple_Generic::connect('mysqli://form_user:1234@localhost/form');
$db->select("SET NAMES utf8");
$db->select("SET time_zone = '+00:00'");
$db->select("SET foreign_key_checks = 0");
$db->select("SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'");
$db->select("DROP TABLE IF EXISTS `ads`");
$db->select("CREATE TABLE `ads` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `private` tinyint(4) NOT NULL,\n `seller_name` varchar(10) NOT NULL,\n `email` varchar(15) NOT NULL,\n `allow_mails` tinyint(4) NOT NULL,\n `phone` varchar(12) NOT NULL,\n `location_id` int(11) NOT NULL,\n `category_id` int(11) NOT NULL,\n `title` varchar(30) NOT NULL,\n `description` varchar(255) NOT NULL,\n `price` varchar(10) NOT NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8");
$db->select("INSERT INTO `ads` (`id`, `private`, `seller_name`, `email`, `allow_mails`, `phone`, `location_id`, `category_id`, `title`, `description`, `price`) VALUES\n (34,1,'4654','4446',1,'464',641490,25,'4564','4465','44'),\n (36,1,'464','446',1,'464',641780,24,'4664','4646','4664')");
$db->select("DROP TABLE IF EXISTS `categories`");
$db->select("CREATE TABLE `categories` (\n `category_id` varchar(3) NOT NULL,\n `category` varchar(10) NOT NULL\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8");
$db->select("INSERT INTO `categories` (`category_id`, `category`) VALUES\n ('24','Квартиры'),\n ('23','Комнаты'),\n ('25','Дома, дачи')");
$db->select("DROP TABLE IF EXISTS `citys`");
$db->select("CREATE TABLE `citys` (\n `location_id` varchar(10) NOT NULL,\n `city` varchar(30) NOT NULL\n ) ENGINE=MyISAM DEFAULT CHARSET=utf8");
$db->select("INSERT INTO `citys` (`location_id`, `city`) VALUES\n ('641780','Новосибирск'),\n ('641490','Барабинск'),\n ('641510','Бердск')");
$db->select("DROP TABLE IF EXISTS `private`");
示例7: adodb_connect
//Establish connection with database // Will be removed.
$db = adodb_connect();
if (!$db) {
echo "Could not connect to database server - please try later.";
exit;
}
if ($_POST["Submit"] == "Submit") {
$error_array = array();
$exempt_array = array("logofile");
//$exempt_array = array () ;
if ($_FILES["logofile"]["name"] != "") {
$vars = array_merge($_POST, $_FILES);
} else {
$vars = $_POST;
}
check_form($vars, $error_array, &$exempt_array);
}
if (count($error_array) == 0 && count($_POST) > 0 && $_POST["Submit"] == "Submit") {
include "{$php_root_path}" . "{$privilege_root_path}/process_edit_conference_info.php";
} else {
do_html_header("Edit Conference Information");
/*echo "Some error";
echo "<pre>";
print_r($error_array);
echo "</pre>";
echo "<br>File type: ".$_FILES["logofile"]["type"];*/
if ($_POST["Submit"] == "Undo Changes") {
unset($_POST);
/*
unset ( $_POST["name"] ) ;
unset ( $_POST["codename"] ) ;
示例8: array
<input type="hidden" name="SessionID" value="<?php
echo $session->SessionID;
?>
">
<input type="submit" name="Submit" value="Delete">
<input type="submit" name="Submit" value="Cancel">
</form>
</td>
</tr>
</table>
<?php
exit;
}
$error_array = array();
if ($_POST["Submit"] == "Submit") {
check_form($_POST, &$error_array, array("SessionID"));
if (count($error_array) == 0) {
$session = new Session();
$session->SessionID = $_POST["SessionID"];
$session->SessionName = $_POST["SessionName"];
$session->TrackID = $_POST["TrackID"];
if (array_key_exists("SessionTrackID", $_POST)) {
$session->SessionTrackID = $_POST["SessionTrackID"];
}
$session->PresentationTypeID = $_POST["PresentationTypeID"];
$session->StartTime = sprintf("%s %02d:%02d:00", $_POST["StartDate"], $_POST["StartHour"] % 12 + ($_POST["StartMeridiem"] == "pm" ? 12 : 0), $_POST["StartMinute"]);
$session->EndTime = sprintf("%s %02d:%02d:00", $_POST["EndDate"], $_POST["EndHour"] % 12 + ($_POST["EndMeridiem"] == "pm" ? 12 : 0), $_POST["EndMinute"]);
$session->RoomID = $_POST["RoomID"];
$session->ChairID = $_POST["ChairID"];
if ($_POST["SessionID"] && !$_GET["duplicate"]) {
$result = update_session($session);
示例9: extract
?>
</section>
<div class="formulaire">
<?php
extract($_POST);
$css_lab_err = "class=\"erreur-label\"";
$css_input_err = "class=\"erreur-label\"";
require_once 'src/php/form.php';
if (!isset($erreurrrr)) {
$erreurrrr[] = 0;
}
if (isset($_POST['submit'])) {
check_form();
/*Extraction des valeurs en variable*/
/*On enregistre dans la BDD*/
//
if (isset($first_name) and isset($last_name) and isset($sex) and isset($age) and isset($home) and isset($postal_code) and isset($study)) {
$first_name = htmlspecialchars($first_name);
$last_name = htmlspecialchars($last_name);
$sex = htmlspecialchars($sex);
$age = htmlspecialchars($age);
$home = htmlspecialchars($home);
$postal_code = htmlspecialchars($postal_code);
$study = htmlspecialchars($study);
if (!isset($work)) {
$work = NULL;
}
$work = htmlspecialchars($work);
示例10: import_csv
function import_csv($file_for_import = '')
{
global $t, $vars, $import_begin_time, $total_added, $csv_duplicate_logins, $amember_duplicate_logins, $input_fields, $fixed_input_fields, $member_additional_fields;
$check_fields_array = array_merge($input_fields, $fixed_input_fields);
foreach ($check_fields_array as $field_name) {
$_SESSION['predefined_fields'][$field_name] = $vars[$field_name];
}
$delim = $vars['delim'];
if (!$file_for_import) {
$file_for_import = $vars['file_for_import'];
}
if (!check_form()) {
if ($f = @fopen($file_for_import, 'r')) {
$line = fgets($f, 4096);
if (preg_match("/\n/", $line) && preg_match("/\r/", $line)) {
$l = $line;
} elseif (preg_match("/\r/", $line)) {
$l = preg_split("/\r/", $line);
$l = $l[0];
} else {
$l = $line;
}
$l = explode($delim, $l);
@fclose($f);
import_select_fields($file_for_import, $delim, $l);
exit;
} else {
import_upload();
exit;
}
}
if ($f = @fopen($file_for_import, 'r')) {
while ($line = fgets($f, 4096)) {
if (!$csv_new_line) {
if (preg_match("/\n/", $line) && preg_match("/\r/", $line)) {
$csv_new_line = 'n';
$line_array = explode($delim, $line);
import_import($line_array);
} elseif (preg_match("/\r/", $line)) {
// bad \r file
$csv_new_line = 'r';
$new_line_lastpos = strrpos($line, "\r");
$good_line = substr($line, 0, $new_line_lastpos);
$tmp_line = substr($line, $new_line_lastpos);
if (substr($tmp_line, 0, 1) == "\r") {
$tmp_line = substr($tmp_line, 1);
}
$tmp_line_array = preg_split("/\r/", $good_line);
foreach ($tmp_line_array as $tmp_line_good) {
$line_array = explode($delim, $tmp_line_good);
import_import($line_array);
}
} else {
$line_array = explode($delim, $line);
import_import($line_array);
}
} else {
if ($csv_new_line == 'r') {
if ($tmp_line) {
$new_line_firstpos = strpos($line, "\r");
$tmp_line .= substr($line, 0, $new_line_firstpos - 1);
$line_array = explode($delim, $tmp_line);
import_import($line_array);
$new_line_lastpos = strrpos($line, "\r");
$good_line = substr($line, $new_line_firstpos, $new_line_lastpos - 1);
$tmp_line_array = preg_split("/\r/", $good_line);
foreach ($tmp_line_array as $tmp_line_good) {
$line_array = explode($delim, $tmp_line_good);
import_import($line_array);
}
$tmp_line = substr($line, $new_line_lastpos);
if (substr($tmp_line, 0, 1) == "\r") {
$tmp_line = substr($tmp_line, 1);
}
}
} else {
$line_array = explode($delim, $line);
import_import($line_array);
}
}
}
@fclose($f);
if ($tmp_line) {
$line_array = explode($delim, $tmp_line);
import_import($line_array);
}
import_import(array(), 1);
} else {
import_upload();
exit;
}
$title = "Import Finished";
$import_took_time = time() - $import_begin_time;
$t->assign('title', $title);
$t->assign('total_added', $total_added);
$t->assign('csv_duplicate_logins', $csv_duplicate_logins);
$t->assign('amember_duplicate_logins', $amember_duplicate_logins);
$t->assign('import_took_time', $import_took_time);
$t->assign('file_for_import', $file_for_import);
admin_log("Import users");
//.........这里部分代码省略.........
示例11: check_form
$ThisPrat = $rsP->FetchRow();
$p = $ThisPrat[pr_ref_idcliente];
$titPrat = $ThisPrat[pr_codice];
//Dati del contatto
$qC = "SELECT * FROM contact WHERE Id = " . $p;
$rsC = $DB->Execute($qC);
$ThisCont = $rsC->FetchRow();
$c = $ThisCont[nome];
$St1 = $CONF[gmail_url];
$StGcal = $CONF[gcal_url];
$StRic = $c;
$Str2 = "&nvp_site_mail=Cerca+nella+posta";
$url = $St1 . $StRic . $Str2;
$mailto = "mailto:?subject=" . $titPrat;
if ($_GET[form_id] == $thissearch[form][name]) {
$error = check_form($thissearch[form], $_GET, $page);
if ($error == 1) {
if (count($_GET[ref_prat][realval]) == 1 && strlen($_GET[ref_prat][realval]) > 0) {
$PAGE_ELEMENT[PAGE][1][0][param] = $_GET[ref_prat][realval][0];
$PAGE[PAGE_INTITLE] .= " <span > ( <a href='{$mailto}'>" . DOCUMENT_NEW_GMAIL . "</a> )\r\n\r\n( <a target=\"\" href=\"#\" onclick=\"javascript:ApriPopUp('{$StGcal}')\">" . DOCUMENT_GCAL . "</a> )\r\n</span>";
}
//INIZIO PAGINA
print '
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<iframe style="display: inline;" id="Fr1" name="Frame1" src=' . $url . ' height="399" width="100%" frameborder=0 MARGINWIDTH="0" marginheight="0" ></iframe>
<br>
';
//FINE PAGINA
if (strlen($_GET[testo]) > 4) {
$resfile = searchDocuments($_GET[testo]);
if (count($resfile) == 0) {
示例12: array
<?php
$php_root_path = "..";
$privilege_root_path = "/user";
require_once "{$php_root_path}/includes/include_all_fns.inc";
//require_once("$php_root_path"."/admin/includes/libmail.php");
$homepage->showmenu = 0;
$err_message = " Unable to process your request due to the following problems: <br>\n";
$error_array = array();
check_form($_POST, $error_array);
if (count($error_array) == 0 && count($_POST) > 0) {
if (forget_password($_POST["username"], &$err_message)) {
do_html_header("Reseting Password Successful", &$err_message);
echo "Your password has been reset and you will receive a new password to your email address shortly.<br><br>Go to the <a href='{$php_root_path}/index.php'>Login</a> page";
do_html_footer(&$err_message);
exit;
} else {
do_html_header("Reseting Password Failed", &$err_message);
$err_message .= " <br><br> Try <a href='forget_pwd.php'>Again</a>? <br>Go to the <a href='{$php_root_path}/index.php'>Login</a> page. <br>\n";
}
} else {
do_html_header("Reset Password", &$err_message);
}
?>
<form action="forget_pwd.php" method="post" name="loginForm" id="loginForm">
<table width="80%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="24" colspan="2">Not registered. <a href="registration.php">Sign up for an account.</a></td>
</tr>
<tr>
<td height="10" colspan="2">Hint: Use your email address as UserName.</td>
示例13: select
$all = select("SELECT * from " . PREFIX . "lng WHERE id={$id}");
$all = $all[0];
echo "<p>Naozaj chcete vymazať túto položku?</p>";
foreach ($all as $key => $a) {
echo "{$key} => {$a} <br />";
}
echo "\n <p>\n <a href=\"?vyber={$vyber}&action=del&id={$all['id']}&confirm=OK\">Áno, vymazať</a>\n ----- \n <a href=\"?vyber={$vyber}\">Nie, vrátiť sa späť</a>\n </p>";
}
}
if ($action == "insert") {
if ($_POST[submit]) {
$id = check_sql($_POST[id]);
$lng_id = check_sql($_POST[lng_id]);
$table = check_sql($_POST[table]);
$text = check_sql($_POST[text]);
$confirm = check_form($text);
if (is_numeric($id) and is_numeric($lng_id)) {
$query = "INSERT INTO " . PREFIX . "lng_{$table} (id, id_lng, id_{$table}, text ) \n VALUES (\"\", \"{$lng_id}\", \"{$id}\", \"{$text}\")";
echo $query;
$result_menu = mysql_query($query, $GLOBALS[link]) or die("SQL nebol uspesne napojeny<br>" . $query . " <br> " . mysql_error($GLOBALS[link]));
if ($set != "") {
header("location: ?vyber={$set}&action=edit&id={$id}");
} else {
header("location: ?vyber={$table}&action=edit&id={$id}");
}
} else {
//header("location: ?vyber=$vyber&action=$action&lng=$lng&meno=$meno&title=$title&meta_descr=$meta_descr");
}
} else {
$id = check_get($_GET[id]);
$table = check_get($_GET[table]);
示例14: error_reporting
<?php
error_reporting(0);
include "dbconnect.php";
include "function.inc.php";
#如果php配置中,magic_quotes_gpc没有被设置,则执行过滤字符串。
$form = check_form($_POST["edit"]);
$form["reg_time"] = date("Y-m-d H:i:s");
$form["pass"] = md5($form["pass"]);
extract($form);
$sql = "insert into users( name,password,sex,mail,tel,reg_time) ";
#这里{}符号是代表在字符串中引用当前环境的变量
$sql .= " values('{$name}',";
$sql .= " '{$pass}',";
$sql .= " '{$sex}',";
$sql .= " '{$mail}', ";
$sql .= " '{$tel}', ";
$sql .= " '{$reg_time}') ";
$res = mysql_query($sql);
if (!$res) {
//die("数据库出错,请返回重试。");
die("mysql error:" . mysql_error());
} else {
echo "success";
}
header("Location:msg.php?m=register_success");
示例15: str_replace
$thisform[onpost] = str_replace("type::add", "type::upd", $thisform[onpost]);
$thisform[Fields][send][content] = "submit||" . ADMIN_TER_PROC_UPD . "||";
} else {
$PAGE[PAGE_INTITLE] = ADMIN_TER_PROC_ADD;
$PAGE[TXT_TITLE] = ADMIN_TER_PROC_ADD;
$response[title] = ADMIN_TER_PROC_ADD_DONE;
$response[text] = ADMIN_TER_PROC_ADD_DONE_TXT . "<br><br>" . make_button("ter_proc_view.php", ADMIN_TER_PROC_BACK_LIST);
$thisform[Fields][send][content] = "submit||" . ADMIN_TER_PROC_ADD . "||";
}
if ($_POST[form_id] == $thisform["name"]) {
if (isset($_POST[form_page])) {
$page = $_POST[form_page];
} else {
$page = 1;
}
$error = check_form($thisform, $_POST, $page);
//echo $error;
if ($error == 1) {
$manage = manage_post($thisform, $error, $_POST, $_GET[id]);
} else {
print draw_form($thisform, $module, $error, $_POST, $page);
}
if ($manage == 1) {
//echo $thisform["name"];echo $manage;
$page = $_POST[form_page] + 1;
print draw_form($thisform, $module, $error, $_POST, $page);
} elseif ($manage > 1) {
print draw_response($response);
}
} else {
print draw_form($thisform, $module, "", $result);