function occur_form() { global $vars; if (empty($vars["submit_form"])) { return display_form(); } // else return process_form(); }
function user_groups() { global $vars, $phpc_cal; if (!$phpc_cal->can_admin()) { return tag('div', __('Permission denied')); } if (!empty($vars['submit_form'])) { process_form(); } return display_form(); }
function user_create() { global $vars; if (!is_admin()) { return tag('div', __('Permission denied')); } if (!empty($vars['submit_form'])) { process_form(); } return display_form(); }
function occur_form() { global $vars; if (empty($vars["submit_form"])) { return display_form(); } // else try { return process_form(); } catch (Exception $e) { message($e->getMessage()); return display_form(); } }
/** * Adiciona o atalho a ser colocado nas páginas e posts. * Atributos a serem considerados. */ function ps_start($args) { /* * Carrega os atributos do atalho. Caso o atalho não possua algum dos parametros abaixo, este parametro será substituído pelo parametro default abaixo. */ $a = shortcode_atts(array('item_id' => '1', 'item_descricao' => 'Descrição de item', 'item_qtd' => '1', 'item_valor' => '0,01', 'item_peso' => '100', 'frete' => '2.00'), $args); if (isset($_POST['submit'])) { process_form(); } /* * Carrega o form de submissao para o botao do pagseguro */ $newpage = get_option("ps_config_newpage"); $headerForm = "<form method='post' action='' "; if (strlen($newpage) > 0) { $headerForm .= " target='_blank'"; } $headerForm .= ">"; echo $headerForm; ?> <input name="item_id" type="hidden" value="<?php echo $a['item_id']; ?> "> <input name="item_descricao" type="hidden" value="<?php echo $a['item_descricao']; ?> "> <input name="item_qtd" type="hidden" value="<?php echo $a['item_qtd']; ?> "> <input name="item_valor" type="hidden" value="<?php echo $a['item_valor']; ?> "> <input name="item_peso" type="hidden" value="<?php echo $a['item_peso']; ?> "> <input name="frete" type="hidden" value="<?php echo $a['frete']; ?> "> <input name="submit" type="submit" value="" class="pagseguro"> </form> <?php }
// I guarantee you'll be glad we did this. :-) $fh = @fopen($GLOBALS['OE_SITE_DIR'] . "/edi/{$bat_filename}", 'a'); if ($fh) { fwrite($fh, $bat_content); fclose($fh); } header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename={$bat_filename}"); header("Content-Description: File Transfer"); header("Content-Length: " . strlen($bat_content)); echo $bat_content; } process_form($_POST); function process_form($ar) { global $bill_info, $webserver_root, $bat_filename, $pdf; if (isset($ar['bn_x12']) || isset($ar['bn_x12_encounter']) || isset($ar['bn_process_hcfa']) || isset($ar['bn_hcfa_txt_file'])) { $hlog = fopen("{$webserver_root}/library/freeb/process_bills.log", 'w'); } if (isset($ar['bn_external'])) { // Open external billing file for output. $be = new BillingExport(); } $db = $GLOBALS['adodb']['db']; if (empty($ar['claims'])) { $ar['claims'] = array(); } $claim_count = 0;
$sgrouping = new skills_grouping($courseid); $groupid = $sgrouping->check_for_user_in_grouping($USER->id); if ($groupid !== false) { $sgroup = new skills_group($groupid); if ($sgroup->get_allow_others_to_join() === true) { $toform['allowjoincheck'] = 1; } } $toform['courseid'] = $courseid; $creategroupform->set_data($toform); if ($creategroupform->is_cancelled()) { $courseurl = new moodle_url('/course/view.php', array('id' => $courseid)); redirect($courseurl); } else { if ($fromform = $creategroupform->get_data()) { $url = process_form($courseid, $fromform); redirect($url); } else { $site = get_site(); echo $OUTPUT->header(); $creategroupform->display(); echo $OUTPUT->footer(); } } /** * This function determines the user's desired course of action -> {create, edit, drop} * and processes it accordingly. * * @param int $courseid The ID of the course. * @param object $submittedform The object contains the results of the form when changes were saved. * @return string|boolean The url to redirect the user to or false to prevent redirect.
$errors = validate_form(); //step one is validation. // errors array lists problems on the form submitted if ($errors) { // display the errors and the form to fix show_errors($errors); if ($_POST['availability'] == null) { $ima = null; } else { $ima = implode(',', $_POST['availability']); } //editied by James Loeffler $person = new Person($_POST['first_name'], $_POST['last_name'], $birthday, $_POST['gender'], $_POST['address'], $_POST['city'], $_POST['state'], $_POST['zip'], $_POST['phone1'], $_POST['phone2'], $_POST['email'], $_POST['type'], $_POST['status'], $_POST['schedule'], $_POST['notes'], $_POST['skills'], $_POST['reason_interested'], $_POST['dateadded'], $_POST['old_pass'], $ima, $_POST['contact_preference']); include 'personForm.inc'; } else { process_form($id); } echo "</div>"; include 'footer.inc'; echo '</div></body></html>'; die; } /** * process_form sanitizes data, concatenates needed data, and enters it all into a database */ function process_form($id) { //echo($_POST['first_name']); //step one: sanitize data by replacing HTML entities and escaping the ' character $first_name = trim(str_replace('\\\'', '', htmlentities(str_replace('&', 'and', $_POST['first_name'])))); // $first_name = str_replace(' ', '_', $first_name);
$ret = course_mod_add::add($module, $courseID, $atstart, (int) $formdata->ifexists, $moduleparams, 0, $visible, $permissionscsvrows); if (!$ret[0]) { $tablefields[] = $ret[1]; } else { $tablefields[] = 'Done'; } $view->output_processing_row($tablefields); sleep(1); } $i++; } $view->output_processing_end(); } // Check user has correct permissions require_login(); require_capability('moodle/site:config', context_system::instance()); // Create view $view = new module_add_view(); // Get list of available modules and set up UI form $modules = $DB->get_records('modules', array('visible' => 1), 'name', 'name'); $modulesAssoc = array(); foreach ($modules as $module) { $modulesAssoc[$module->name] = $module->name; } $moduleaddform = new module_add_form($modulesAssoc); $view->set_form($moduleaddform); if (!($formdata = $moduleaddform->get_data())) { $view->output_form(); } else { process_form($view, $moduleaddform, $formdata); }
<div id="content"> <?php include 'personValidate.inc'; if ($_POST['_form_submit'] != 1) { //in this case, the form has not been submitted, so show it include 'personForm.inc'; } else { //in this case, the form has been submitted, so validate it $errors = validate_form(); //step one is validation. // errors array lists problems on the form submitted if ($errors) { // display the errors and the form to fix show_errors($errors); } else { $newperson = process_form($id, $person); if ($_POST['deleteMe'] != "DELETE" && $_POST['reset_pass'] != "RESET") { echo 'Update successful. Click <a href=personEdit.php?id=' . $newperson->get_id() . '> edit</a> to review your changes.'; } } include 'footer.inc'; echo '</div></div></body></html>'; die; } include 'footer.inc'; /** * process_form sanitizes data, concatenates needed data, and enters it all into the database */ function process_form($id, $person) { // Get the info of the user who is making the update
foreach ($_POST['availability'] as $postday) { $postavail[] = $postday; } $availability = implode(',', $postavail); } if ($_POST['isstudent'] == "yes") { $position = "student"; $employer = $_POST['nameofschool']; } else { $position = $_POST['position']; $employer = $_POST['employer']; } $person = new Person($person->get_first_name(), $_POST['last_name'], $_POST['location'], $_POST['address'], $_POST['city'], $_POST['state'], $_POST['zip'], $person->get_phone1(), $_POST['phone1type'], $_POST['phone2'], $_POST['phone2type'], $_POST['email'], implode(',', $_POST['type']), $_POST['screening_type'], implode(',', $_POST['screening_status']), $_POST['status'], $employer, $position, $_POST['credithours'], $_POST['commitment'], $_POST['motivation'], $_POST['specialties'], $_POST['convictions'], $availability, $_POST['schedule'], $_POST['hours'], $_POST['birthday'], $_POST['start_date'], $_POST['howdidyouhear'], $_POST['notes'], $_POST['old_pass']); include 'personForm.inc'; } else { process_form($id, $person); } echo "</div>"; include 'footer.inc'; echo '</div></body></html>'; die; } /** * process_form sanitizes data, concatenates needed data, and enters it all into a database */ function process_form($id, $person) { //echo($_POST['first_name']); //step one: sanitize data by replacing HTML entities and escaping the ' character if ($person->get_first_name() == "new") { $first_name = trim(str_replace('\\\'', '', htmlentities(str_replace('&', 'and', $_POST['first_name']))));
$user_endtime = time() + $max_time; } if ($user_endtime <= time()) { if ($user_alldone == 0) { $querybad = "UPDATE " . USER_TABLE . " SET " . "user_alldone=1 WHERE " . "user_id=" . $user_id . " AND " . "user_name='" . $_SESSION['hs_uname'] . "'" . "LIMIT 1"; $result = $conn->query($querybad) or msg_die($conn->error, 'D'); } $extra_time = sec2min(time() - $user_endtime); render_page('Time Over', phtml('time-out', [], false), $script_path); } else { $current_challenge = $user_chalcompleted + 1; if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['btnSubmit'])) { $stop_update = false; if (isset($_POST['txtPassword'])) { if ($_POST['txtPassword'] != '' || $current_challenge == 1) { if (get_pwd($user_chalcompleted) == process_form($_POST['txtPassword'])) { if (!$stop_update) { $_SESSION['hs_ch_complete'] = true; $_SESSION['hs_last_ch'] = $current_challenge; $current_points = $user_totalpoints + $_SESSION['hs_challocatedpts']; if (isset($_SESSION['hs_used_clue'])) { $user_cluestaken++; } if ($current_challenge == 9) { $done = true; } if (isset($done) && $done) { $queryupdate = "UPDATE " . USER_TABLE . " SET " . "user_totalchallenges=" . $current_challenge . ", " . "user_totalpoints=" . $current_points . ", " . "user_cluestaken=" . $user_cluestaken . ", " . "user_endtime=" . time() . ", " . "user_alldone=1 WHERE " . "user_id=" . $user_id . " AND " . "user_name='" . $_SESSION['hs_uname'] . "' " . "LIMIT 1"; } else { $queryupdate = "UPDATE " . USER_TABLE . " SET " . "user_totalchallenges=" . $current_challenge . ", " . "user_totalpoints=" . $current_points . ", " . "user_cluestaken=" . $user_cluestaken . " WHERE " . "user_id=" . $user_id . " AND " . "user_name='" . $_SESSION['hs_uname'] . "' " . "LIMIT 1"; }
if ($week->get_status() == "unpublished" || $week->get_status() == "archived") { delete_dbWeeks($week); add_log_entry('<a href=\\"personEdit.php?id=' . $_SESSION['_id'] . '\\">' . $_SESSION['f_name'] . ' ' . $_SESSION['l_name'] . '</a> removed the week of <a href=\\"calendar.php?id=' . $week->get_id() . '&edit=true\\">' . $week->get_name() . '</a>.'); echo "<p>Week \"" . $week->get_name() . "\" removed.<br>"; } else { echo "<p>Week \"" . $week->get_name() . "\" is published, so it cannot be removed.<br>"; } } //include('addWeek_newweek.inc'); //unset($_GET('remove')); echo "<br> (Back to <a href=\"addWeek.php?venue=" . $venue . "&archive=" . $_GET['archive'] . "\"><b>manage weeks</b></a>)"; } else { if (!array_key_exists('_submit_check_newweek', $_POST)) { include 'addWeek_newweek.inc'; } else { process_form($firstweek, $venue); include 'addWeek_newweek.inc'; } } } // must be a manager function process_form($firstweek, $venue) { if ($_SESSION['access_level'] < 2) { return null; } if ($firstweek == true) { //find the beginning of the current week $dow = strtotime("last Monday"); $m = date("m", $dow); $d = date("d", $dow);
echo '<p><b>Select a Screening: </b>'; include "viewScreenings.inc.php"; } else { if ($_POST['s_type'] == "new") { $action = $_POST['s_type']; echo '<p><b>Create new Screening: </b>'; $new = true; include 'viewScreenings.inc.php'; } else { if ($_POST['_form_submit'] == 1) { $action = $_POST['s_type']; echo '<p><b>Edit Screening: </b>' . $action; include 'viewScreenings.inc.php'; } else { // changes submitted, so process them and display the result process_form($screening); } } } /** * process_form gathers data and enters it into a database */ function process_form($oldScreening) { //step one: gather data. $oldType = $_POST['_old_type']; if ($_POST['_form_type'] == "new") { $creator = $_SESSION['_id']; } else { $creator = $oldScreening->get_creator(); }
$patient_DOB = $guest->get_patient_birthdate(); } $tempBooking = new Booking(date("y-m-d"), "Will Call", $guest->get_id(), $status, "", $guest->get_patient_name(), "", "", "", "", "", "", "", "00000000000", "", "", "", "", "new"); } } include 'autofillReferralForm.inc'; } // now process the form that has been submitted if ($_POST['submit'] == 'Submit') { // check for errors include 'bookingValidate.inc'; $errors = validate_form(); if ($errors) { show_errors($errors); } else { $primaryGuest = process_form(); $tempBooking = build_POST_booking($primaryGuest, $referralid); echo "Thank you, your referral form has been submitted for review by the House Manager."; // Create the log message $message = "<a href='viewPerson.php?id=" . $_SESSION['_id'] . "'>" . $user_name . "</a>" . " has added a referral for <a href='viewPerson.php?id=" . $primaryGuest->get_id() . "'>" . $primaryGuest->get_first_name() . " " . $primaryGuest->get_last_name() . "</a>"; add_log_entry($message); } } include_once "footer.inc"; ?> </div> </div> </body> </html> <?php
<?php require 'formhelpers.php'; if ($_POST['_submit_check']) { if ($form_errors = validate_form()) { show_form($form_errors); } else { process_form(); } } else { show_form(); } function show_form($errors = '') { if ($errors) { print 'You need to correct the following errors: <ul><li>'; print implode('</li><li>', $errors); print '</li></ul>'; } // the beginning of the form print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; print '<table>'; // the search term print '<tr><td>Search Term:</td><td>'; input_text('term', $_POST); print '</td></tr>'; // form end print '<tr><td colspan="2"><input type="submit" value="Search News Feed"></td></tr>'; print '</table>'; print '<input type="hidden" name="_submit_check" value="1"/>'; print '</form>';
<?php /* If you see this text in your browser, PHP is not configured correctly on this hosting provider. Contact your hosting provider regarding PHP configuration for your site. PHP file generated by Adobe Muse CC 2015.0.2.310 */ require_once 'form_process.php'; $form = array('subject' => 'Отправка Контактные данные клиента(Моб)', 'heading' => 'Отправка новой формы', 'success_redirect' => '', 'resources' => array('checkbox_checked' => 'Отмечено', 'checkbox_unchecked' => 'Флажок не установлен', 'submitted_from' => 'Формы, отправленные с веб-сайта: %s', 'submitted_by' => 'IP-адрес посетителя: %s', 'too_many_submissions' => 'Недопустимо высокое количество отправок с этого IP-адреса за последнее время', 'failed_to_send_email' => 'Не удалось отправить сообщение эл. почты', 'invalid_reCAPTCHA_private_key' => 'Недействительный закрытый ключ reCAPTCHA.', 'invalid_field_type' => 'Неизвестный тип поля \'%s\'.', 'invalid_form_config' => 'Недопустимая конфигурация поля \\"%s\\".', 'unknown_method' => 'Неизвестный метод запроса сервера'), 'email' => array('from' => '*****@*****.**', 'to' => '*****@*****.**'), 'fields' => array('custom_U3682' => array('order' => 1, 'type' => 'string', 'label' => 'Ваше имя', 'required' => true, 'errors' => array('required' => 'Поле \'Ваше имя\' не может быть пустым.')), 'Email' => array('order' => 2, 'type' => 'email', 'label' => 'Электронная почта', 'required' => true, 'errors' => array('required' => 'Поле \'Электронная почта\' не может быть пустым.', 'format' => 'Поле \'Электронная почта\' содержит недействительное сообщение эл. почты.')), 'custom_U3677' => array('order' => 3, 'type' => 'string', 'label' => 'Телефон или Skype', 'required' => true, 'errors' => array('required' => 'Поле \'Телефон или Skype\' не может быть пустым.')))); process_form($form);
if ($si->get_custom_label() != null) { $toform[$customlabelcheckbox] = true; $toform[$customlabelfield] = $si->get_custom_label(); } else { $toform[$customlabelcheckbox] = false; } } $naveditform->set_data($toform); if ($naveditform->is_cancelled()) { // Cancelled forms redirect to the course main page. $courseurl = new moodle_url('/course/view.php', array('id' => $courseid)); redirect($courseurl); } else { if ($fromform = $naveditform->get_data()) { // Process form and redirect on completion. process_form($courseid, $blockid, $fromform, $sectionheaders, $numberofsections); $courseurl = new moodle_url('/course/view.php', array('id' => $courseid)); redirect($courseurl); } else { // Form didn't validate or this is the first display. $site = get_site(); echo $OUTPUT->header(); $naveditform->display(); echo $OUTPUT->footer(); } } /** * This function processes the submitted form for all of the sections. Most of the work * is completed via using the section_icon class and its associated routines. The data * is pulled from the form, a check is made to see if any boxes are ticked, then the * desired result is processed. Any draft files that need to be saved are saved in this