本文整理汇总了PHP中processForm函数的典型用法代码示例。如果您正苦于以下问题:PHP processForm函数的具体用法?PHP processForm怎么用?PHP processForm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了processForm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildAgencyForm
// is the result of an error message
if (!isset($agency)) {
$aAgency['name'] = $GLOBALS['strUntitled'];
$aAgency['contact'] = '';
$aAgency['email'] = '';
$aAgency['logout_url'] = '';
}
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build agency form
$agencyForm = buildAgencyForm($aAgency);
if ($agencyForm->validate()) {
//process submitted values
processForm($aAgency, $agencyForm);
} else {
//either validation failed or form was not submitted, display the form
displayPage($aAgency, $agencyForm);
}
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildAgencyForm($aAgency)
{
$form = new OA_Admin_UI_Component_Form("agencyform", "POST", $_SERVER['SCRIPT_NAME']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'agencyid', $aAgency['agencyid']);
$form->addElement('header', 'header_basic', $GLOBALS['strBasicInformation']);
$form->addElement('text', 'name', $GLOBALS['strName']);
$form->addElement('text', 'contact', $GLOBALS['strContact']);
示例2: buildZoneForm
$zone['zonename'] .= $GLOBALS['strDefault'];
$zone['description'] = '';
$zone['width'] = '468';
$zone['height'] = '60';
$zone['delivery'] = phpAds_ZoneBanner;
$zone['comments'] = null;
}
$zone['affiliateid'] = $affiliateid;
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build form
$zoneForm = buildZoneForm($zone);
if ($zoneForm->validate()) {
//process submitted values
$errors = processForm($zoneForm);
if (!empty($errors)) {
}
}
//display the page - show any validation errors that may have occured
displayPage($zone, $zoneForm, $errors);
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildZoneForm($zone)
{
global $conf;
// Initialise Ad Networks
$oAdNetworks = new OA_Central_AdNetworks();
$form = new OA_Admin_UI_Component_Form("zoneform", "POST", $_SERVER['PHP_SELF']);
$form->forceClientValidation(true);
示例3: showForm
function showForm($option, $fid)
{
global $mainframe, $limitstart, $acl, $formeConfig;
$my =& JFactory::getUser();
$processform = JRequest::getVar('form', array(), 'POST');
$database =& JFactory::getDBO();
if (!$fid) {
//get first cid
$database->setQuery("SELECT id FROM #__forme_forms WHERE published = 1 LIMIT 1");
$fid = (int) $database->loadResult();
}
//check language
//first check global joomfish
$check = false;
if (isset($_COOKIE['mbfcookie']['lang'])) {
$check = $_COOKIE['mbfcookie']['lang'];
}
if (isset($_COOKIE['jfcookie']['lang'])) {
$check = $_COOKIE['jfcookie']['lang'];
}
if (isset($_REQUEST['lang'])) {
$check = JRequest::getVar('lang', false);
}
if ($check) {
$oldform = new forme_forms($database);
$oldform->load($fid);
//check if we find something similar
$database->setQuery("SELECT id FROM #__forme_forms WHERE lang='{$check}' AND name='{$oldform->name}' ");
$newfid = $database->loadResult();
if ($newfid) {
$fid = $newfid;
}
}
processForm($fid, $processform);
$query = "SELECT * FROM #__forme_forms WHERE id = '{$fid}' AND published = '1'";
$database->setQuery($query);
$form = $database->loadObjectList();
//load fields
$query = "SELECT * FROM #__forme_fields WHERE form_id = '{$fid}' AND published = '1' ORDER BY ordering";
$database->setQuery($query);
$fields = $database->loadObjectList();
$form = $form[0];
if (!$form->published) {
$mainframe->redirect(JURI::base(), _NOT_EXIST);
}
//Output
forme_HTML::showForm($option, $form, $fields);
}
示例4: buildZoneForm
$aZone['appendtype'] = phpAds_ZoneAppendRaw;
}
//extract chainzone
if (ereg("^zone:([0-9]+)\$", $aZone['chain'], $regs)) {
$aZone['chainzone'] = $regs[1];
} else {
$aZone['chainzone'] = '';
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build zone adv form
$zoneForm = buildZoneForm($aZone);
if ($zoneForm->validate()) {
//process submitted values
processForm($aZone, $zoneForm);
} else {
//either validation failed or form was not submitted, display the form
displayPage($aZone, $zoneForm);
}
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildZoneForm($aZone)
{
$form = new OA_Admin_UI_Component_Form("zoneform", "POST", $_SERVER['PHP_SELF']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'zoneid', $aZone['zoneid']);
$form->addElement('hidden', 'affiliateid', $aZone['affiliateid']);
buildChainSettingsFormSection($form, $aZone);
buildDeliveryCappingFormSection($form, $GLOBALS['strCappingZone'], $aZone);
示例5: buildWebsiteForm
//set some default
$affiliate['website'] = 'http://';
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
// check if Thorium plugin is enabled
$oComponent = null;
if (isset($GLOBALS['_MAX']['CONF']['plugins']['openXThorium']) && $GLOBALS['_MAX']['CONF']['plugins']['openXThorium']) {
$oComponent =& OX_Component::factory('admin', 'oxThorium', 'oxThorium');
}
//build form
$websiteForm = buildWebsiteForm($affiliate);
if ($websiteForm->validate()) {
//process submitted values
$oPublisherDll = processForm($affiliateid, $websiteForm, $oComponent);
if ($oPublisherDll->_errorMessage || $oPublisherDll->_noticeMessage) {
displayPage($affiliateid, $websiteForm, $oPublisherDll);
}
} else {
//either validation failed or form was not submitted, display the form
displayPage($affiliateid, $websiteForm);
}
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildWebsiteForm($affiliate)
{
$form = new OA_Admin_UI_Component_Form("affiliateform", "POST", $_SERVER['SCRIPT_NAME']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'affiliateid', $affiliate['affiliateid']);
示例6: processForm
<?php
if (isset($_POST["submitButton"])) {
processForm();
} else {
displayForm(array());
}
function validateField($fieldName, $missingFields)
{
if (in_array($fieldName, $missingFields)) {
return ' class="error"';
}
}
function setValue($fieldName)
{
if (isset($_POST[$fieldName])) {
return htmlspecialchars($_POST[$fieldName]);
}
}
function setChecked($fieldName, $fieldValue)
{
if (isset($_POST[$fieldName]) and $_POST[$fieldName] == $fieldValue) {
return ' checked="checked"';
}
}
function setSelected($fieldName, $fieldValue)
{
if (isset($_POST[$fieldName]) and $_POST[$fieldName] == $fieldValue) {
return ' selected="selected"';
}
}
示例7: switch
Application::sendJson(["err" => "UNDEFINED_ACTION"]);
}
$action = $_POST['action'];
if (!isset($_POST['id'])) {
Application::sendJson(["err" => "UNDEFINED_EVENT_ID"]);
}
$event = GreaseRatEvent::retrieveByPK(intval($_POST['id']));
if (!$event) {
Application::sendJson(["err" => "UNDEFINED_EVENT"]);
}
switch ($action) {
case "DELETE":
$event->delete();
Application::sendJson(["err" => "OK"]);
break;
case "MOVE":
if (!isset($_POST["data"])) {
Application::sendJson(["err" => "UNDEFINED_FORM_DATA"]);
}
$_POST["data"]["id"] = intval($_POST['id']);
Application::sendJson(processForm($_POST["data"]));
break;
default:
Application::sendJson(["err" => "UNDEFINED_ACTION"]);
break;
}
});
Macaw::error(function () {
echo '404 :: Not Found';
});
Macaw::dispatch();
示例8: buildAdvertiserForm
$aAdvertiser['contact'] = '';
$aAdvertiser['comments'] = '';
$aAdvertiser['email'] = '';
$aAdvertiser['reportdeactivate'] = 'f';
$aAdvertiser['report'] = 'f';
$aAdvertiser['reportinterval'] = 7;
}
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build advertiser form
$advertiserForm = buildAdvertiserForm($aAdvertiser);
if ($advertiserForm->validate()) {
//process submitted values
processForm($aAdvertiser, $advertiserForm);
} else {
//either validation failed or form was not submitted, display the form
displayPage($aAdvertiser, $advertiserForm);
}
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildAdvertiserForm($aAdvertiser)
{
$form = new OA_Admin_UI_Component_Form("clientform", "POST", $_SERVER['SCRIPT_NAME']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'clientid', $aAdvertiser['clientid']);
$form->addElement('header', 'header_basic', $GLOBALS['strBasicInformation']);
$nameElem = $form->createElement('text', 'clientname', $GLOBALS['strName']);
if (!OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
示例9: getDividerType
}
function getDividerType($dividerType)
{
switch ($dividerType) {
case "Space":
return " ";
break;
case "Hyphen":
return "-";
break;
case "Underscore":
return "_";
break;
}
}
function formatWord($formatType, $wordToFormat)
{
switch ($formatType) {
case "Uppercase":
return strtoupper($wordToFormat);
break;
case "Lowercase":
return strtolower($wordToFormat);
break;
case "Pascal":
return ucfirst($wordToFormat);
break;
}
}
$finalPassword = processForm($word_array, $char_array, $num_array);
示例10: pageController
function pageController()
{
$errors['count'] = 0;
if (!empty($_GET['id'])) {
$adID = $_GET['id'];
$adObject = AdModel::find($adID);
}
$imageSuccessMessage = "";
//if an image was submitted - validate it even before validating the rest of the form
if (!empty($_POST['upload-image']) && $_FILES['fileToUpload']['name'] != '') {
try {
$postImage = Input::getImage();
//image was successfully uploaded
$imageSuccessMessage = "Image: " . basename($_FILES['fileToUpload']['name']) . " has been uploaded!";
//store image in the session
$_SESSION['image'] = $postImage;
} catch (Exception $e) {
$errors['image'] = 'Image: ' . $e->getMessage();
$errors['count']++;
}
}
//clicked on the upload image button without selecting a photo
if (!empty($_POST['upload-image']) && $_FILES['fileToUpload']['name'] == '') {
$errors['image'] = "Image: Select an image to upload!";
$errors['count']++;
}
//an image has been submitted; use the image stored in the $_SESSION
if (isset($_SESSION['image'])) {
$postImage = $_SESSION['image'];
} else {
//use the image stored in the database
$postImage = "Database Image";
}
//if there weren't any errors with the image; then, process then rest of the form
if ($errors['count'] == 0) {
$errors = processForm($adObject, $postImage);
// $errors = processForm($adObject->category, $adObject->date_posted, $postImage);
}
return array('adObject' => $adObject, 'errorMessages' => $errors);
}
示例11: array
global $session;
$aVersion['major'] = 0;
$aVersion['minor'] = 0;
$aVersion['build'] = 1;
$aVersion['status'] = '-dev';
$aValues['name'] = $name ? $name : $oTrans->translate("myPlugin");
$aValues['email'] = $email ? $email : $session['user']->aUser['email_address'];
$aValues['author'] = $author ? $author : $session['user']->aUser['contact_name'];
$aValues['url'] = $url ? $url : $GLOBALS['HTTP_SERVER_VARS']['HTTP_HOST'];
$aValues['licence'] = $licence ? $licence : 'GPL';
$aValues['description'] = $description ? $description : $oTrans->translate("My New Plugin");
$aValues['group'] = $group ? $group : array();
$aValues['version'] = $version ? $version : $aVersion;
$form = buildForm();
if ($form->validate()) {
$aMessages = processForm($form, $aValues);
} else {
$form->setDefaults($aValues);
}
displayPage($form, $aMessages);
function &buildForm()
{
global $oTrans;
$form = new OA_Admin_UI_Component_Form("oxToolBoxForm", "POST", $_SERVER['SCRIPT_NAME'], null, array("enctype" => "multipart/form-data"));
$form->forceClientValidation(true);
$form->addElement('header', 'header', $oTrans->translate("New Plugin"));
$form->addElement('text', 'name', $oTrans->translate("Plugin Name"), array('class' => 'medium'));
$form->addElement('text', 'email', $oTrans->translate("Author Email"));
$form->addElement('text', 'author', $oTrans->translate("Author Name"));
$form->addElement('text', 'url', $oTrans->translate("Author URL"));
$form->addElement('text', 'licence', $oTrans->translate("Licence Info"));
示例12: saveData
*/
function saveData($vote, $comment = "", $sourceId)
{
if ($vote > 0 && $vote < 10) {
global $db;
$sql = "INSERT INTO pgn_rating (VOTE, COMMENT, SOURCEID) VALUES({$vote}, '" . addslashes($comment) . "', {$sourceId})";
$query = new query($db, $sql);
$query->free();
return true;
}
return false;
}
$sourceId = value("source", "NUMERIC", "");
$out .= '<table style="font-face:arial; font-size:12px;">' . "<tr>";
$out .= '<form name="rate" method="post">';
if (processForm($sourceId)) {
$out .= '<td class="rate_copy">Thank your for your vote and opinion.</td></tr><tr>';
} else {
$out .= '<td colspan="11" class="rate_label">Is this article helpful?</td></tr><tr>';
$out .= '<td colspan="11" class="rate_copy"><img src="sys/ptrans.gif" border="0" height="5" width="1">' . "</td></tr><tr>";
$out .= '<td class="rate_label" width="10%"> <input type="hidden" name="pgnratingsend' . $sourceId . '" value="1"></td>';
for ($i = 1; $i < 10; $i++) {
$out .= '<td class="rate_copy" align="center" width="10%">' . $i . '</td>';
}
$out .= '<td class="rate_copy" width="10%"> </td>' . "</tr><tr>";
$out .= '<td class="rate_label" width="10%">Poor</td>';
for ($i = 1; $i < 10; $i++) {
$out .= '<td class="rate_copy" align="center" width="10%"><input type="radio" name="pgnrating' . $sourceId . '" value="' . $i . '"></td>';
}
$out .= '<td class="rate_copy" width="10%">Great</td>' . "</tr><tr>";
$out .= '<td colspan="11" class="rate_copy"><img src="sys/ptrans.gif" border="0" height="5" width="1">' . "</td></tr><tr>";
示例13: pageController
function pageController()
{
$errors = processForm();
return array('errorMessages' => $errors);
}
示例14: isset
}
$tracker['trackername'] .= $strDefault . " " . $strTracker;
$tracker['status'] = isset($pref['tracker_default_status']) ? $pref['tracker_default_status'] : MAX_CONNECTION_STATUS_APPROVED;
$tracker['type'] = isset($pref['tracker_default_type']) ? $pref['tracker_default_type'] : MAX_CONNECTION_TYPE_SALE;
$tracker['linkcampaigns'] = $pref['tracker_link_campaigns'] == true ? 't' : 'f';
$tracker['description'] = '';
$tracker['clientid'] = $clientid;
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build form
$trackerForm = buildTrackerForm($tracker);
if ($trackerForm->validate()) {
//process submitted values
processForm($trackerForm);
} else {
//either validation failed or form was not submitted, display the form
displayPage($tracker, $trackerForm);
}
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildTrackerForm($tracker)
{
$form = new OA_Admin_UI_Component_Form("trackerform", "POST", $_SERVER['SCRIPT_NAME']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'trackerid', $tracker['trackerid']);
$form->addElement('hidden', 'clientid', $tracker['clientid']);
$form->addElement('hidden', 'move', $tracker['move']);
$form->addElement('header', 'basic_info', $GLOBALS['strTrackerInformation']);
示例15: buildZoneForm
$zone['zonename'] .= $GLOBALS['strDefault'];
$zone['description'] = '';
$zone['width'] = '468';
$zone['height'] = '60';
$zone['delivery'] = phpAds_ZoneBanner;
$zone['comments'] = null;
}
$zone['affiliateid'] = $affiliateid;
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING */
/*-------------------------------------------------------*/
//build form
$zoneForm = buildZoneForm($zone, $oComponent);
if ($zoneForm->validate()) {
//process submitted values
$errors = processForm($zoneForm, $oComponent);
if (!empty($errors)) {
}
}
//display the page - show any validation errors that may have occurred
displayPage($zone, $zoneForm, $errors);
/*-------------------------------------------------------*/
/* Build form */
/*-------------------------------------------------------*/
function buildZoneForm($zone, $oComponent = null)
{
global $conf;
$newZone = empty($zone['zoneid']);
$form = new OA_Admin_UI_Component_Form("zoneform", "POST", $_SERVER['SCRIPT_NAME']);
$form->forceClientValidation(true);
$form->addElement('hidden', 'zoneid', $zone['zoneid']);