// 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']);
$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);
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); }
$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);
//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']);
<?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"'; } }
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();
$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)) {
} 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);
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); }
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"));
*/ 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>";
function pageController() { $errors = processForm(); return array('errorMessages' => $errors); }
} $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']);
$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']);
* @license GPLv2 http://files.syscp.org/misc/COPYING.txt * @package Panel * @version $Id$ */ define('AREA', 'admin'); /** * Include our init.php, which manages Sessions, Language etc. */ $need_db_sql_data = true; $need_root_db_sql_data = true; require "./lib/init.php"; if (($page == 'settings' || $page == 'overview') && $userinfo['change_serversettings'] == '1') { $settings_data = loadConfigArrayDir('./actions/admin/settings/'); $settings = loadSettings(&$settings_data, &$db); if (isset($_POST['send']) && $_POST['send'] == 'send') { if (processForm(&$settings_data, &$_POST, array('filename' => $filename, 'action' => $action, 'page' => $page))) { standard_success('settingssaved', '', array('filename' => $filename, 'action' => $action, 'page' => $page)); } } else { $fields = buildForm(&$settings_data); eval("echo \"" . getTemplate("settings/settings") . "\";"); } } elseif ($page == 'rebuildconfigs' && $userinfo['change_serversettings'] == '1') { if (isset($_POST['send']) && $_POST['send'] == 'send') { $log->logAction(ADM_ACTION, LOG_INFO, "rebuild configfiles"); inserttask('1'); inserttask('4'); inserttask('5'); redirectTo('admin_index.php', array('s' => $s)); } else { ask_yesno('admin_configs_reallyrebuild', $filename, array('page' => $page));
function pageController() { $errors['count'] = 0; $arrayCategoriesArray = CategoryModel::all(); foreach ($arrayCategoriesArray as $categoriesArray) { $categorySelectionList[] = $categoriesArray['category_name']; } $imageSuccessMessage = ""; //if an image was submitted - validate it even before validating the rest of the form if (isset($_FILES['fileToUpload']) && $_FILES['fileToUpload']['name'] != '') { try { $postImage = Input::getImage('fileToUpload'); //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 (isset($_FILES['fileToUpload']) && $_FILES['fileToUpload']['name'] == '') { $errors['image'] = "Image: Select an image to upload!"; $errors['count']++; } //if the session['image'] is empty; then, no image was submitted if (!isset($_SESSION['image'])) { //no image was submitted - use placeholder image $postImage = "http://placehold.it/350x300"; } else { //an image has been submitted; use the image stored in the $_SESSION $postImage = $_SESSION['image']; } //if there weren't any errors with the image; then, process then rest of the form if ($errors['count'] == 0) { $errors = processForm($postImage); } return array('categorySelectionList' => $categorySelectionList, 'errorMessages' => $errors, 'imageSuccessMessage' => $imageSuccessMessage); }
$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, $oComponent); if ($zoneForm->validate()) { //process submitted values processForm($aZone, $zoneForm, $oComponent); } else { //either validation failed or form was not submitted, display the form displayPage($aZone, $zoneForm); } /*-------------------------------------------------------*/ /* Build form */ /*-------------------------------------------------------*/ function buildZoneForm($aZone, $oComponent = null) { $form = new OA_Admin_UI_Component_Form("zoneform", "POST", $_SERVER['SCRIPT_NAME']); $form->forceClientValidation(true); $form->addElement('hidden', 'zoneid', $aZone['zoneid']); $form->addElement('hidden', 'affiliateid', $aZone['affiliateid']); buildChainSettingsFormSection($form, $aZone); if ($oComponent && method_exists($oComponent, 'extendZoneAdvancedForm')) {
$user->setMemberId(7); $start = array('year' => date('Y', strtotime('+2 week')), 'month' => (int) date('m', strtotime('+2 week')), 'day' => (int) date('d', strtotime('+2 week'))); $start_t = array('hour' => '12', 'minute' => '0'); $end = array('year' => date('Y', strtotime('+2 week')), 'month' => (int) date('m', strtotime('+2 week')), 'day' => (int) date('d', strtotime('+2 week'))); $end_t = array('hour' => '12', 'minute' => '15'); $resources = array(1 => '3', 2 => '', 3 => '', 4 => '', 5 => ''); $t->cmp_ok(processForm($start, $start_t, $end, $end_t, $resources, array($user->getMemberId())), '===', false, 'member_id 7 が二週間後の12:00〜12:15のスケジュール作成, 小会議室Aを1つ予約:isValid() false を返す'); $schedule->delete(); $resources = array(1 => '', 2 => '3', 3 => '3', 4 => '', 5 => ''); $t->isa_ok(processForm($start, $start_t, $end, $end_t, $resources, array($user->getMemberId())), 'Schedule', 'member_id 13 がスケジュールを削除したため、member_id 2 が再度二週間後の12:00〜12:15のスケジュール作成, 小会議室Aを2つ予約:Schedule インスタンスを返す'); $user->clearSessionData(); $user->setAuthenticated(true); $user->setMemberId(4); $t->cmp_ok(processForm($start, $start_t, $end, $end_t, $resources, array($user->getMemberId())), '===', false, 'member_id 4が二週間後の12:00〜12:15のスケジュール作成, 小会議室Aを1つ予約:isValid() false を返す'); Doctrine::getTable('Member')->find(7)->delete(); $t->isa_ok(processForm($start, $start_t, $end, $end_t, $resources, array($user->getMemberId())), 'Schedule', 'member_id 7 が退会したので member_id 4が二週間後の12:00〜12:15のスケジュール作成, 小会議室Aを1つ予約:Schedule インスタンスを返す'); /* * テスト用processForm */ function processForm($start, $start_t, $end, $end_t, $schedule_resorces, $schedule_members = array(1), $public_flag = 1, $isUseCSRF = true) { $form = new ScheduleForm(); $form->getObject()->setMemberId(sfContext::getInstance()->getUser()->getMemberId()); $params = array('title' => 'test', 'body' => 'test', 'start_date' => $start, 'start_time' => $start_t, 'end_date' => $end, 'end_time' => $end_t, 'public_flag' => $public_flag, 'schedule_member' => $schedule_members, '_csrf_token' => $isUseCSRF ? $form->getCSRFToken() : ''); for ($i = 1; $i <= 5; $i++) { $params['schedule_resource_lock_' . $i] = array('schedule_resource_id' => $schedule_resorces[$i]); } $form->bind($params); if ($form->isValid()) { return $form->save(); }
} if (!empty($affiliateid)) { /*-------------------------------------------------------*/ /* Store preferences */ /*-------------------------------------------------------*/ $session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['affiliateid'] = $affiliateid; phpAds_SessionDataStore(); } /*-------------------------------------------------------*/ /* MAIN REQUEST PROCESSING */ /*-------------------------------------------------------*/ //build form $channelForm = buildChannelForm($channel); if ($channelForm->validate()) { //process submitted values processForm($channelForm); } else { //either validation failed or form was not submitted, display the form displayPage($channel, $channelForm); } /*-------------------------------------------------------*/ /* Build form */ /*-------------------------------------------------------*/ function buildChannelForm($channel) { $form = new OA_Admin_UI_Component_Form("channelform", "POST", $_SERVER['PHP_SELF']); $form->forceClientValidation(true); $form->addElement('hidden', 'agencyid', OA_Permission::getAgencyId()); $form->addElement('hidden', 'affiliateid', $channel['affiliateid']); $form->addElement('hidden', 'channelid', $channel['channelid']); $form->addElement('header', 'header_basic', $GLOBALS['strBasicInformation']);
$componentIdentifier = $tmpComponent->getComponentIdentifier(); $bannerTypes['text'][$componentIdentifier] = $tmpComponent->getOptionDescription(); } } if (!$type) { if ($show_txt) { $type = "txt"; } } $form = buildBannerForm($type, $aBanner, $oComponent, $formDisabled); $valid = $form->validate(); if ($valid && $oComponent && $oComponent->enabled) { $valid = $oComponent->validateForm($form); } if ($valid) { processForm($bannerid, $form, $oComponent, $formDisabled); } else { displayPage($bannerid, $campaignid, $clientid, $bannerTypes, $aBanner, $type, $form, $ext_bannertype, $formDisabled); } function displayPage($bannerid, $campaignid, $clientid, $bannerTypes, $aBanner, $type, $form, $ext_bannertype, $formDisabled = false) { $pageName = 'advertiser-campaigns'; $aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid, 'bannerid' => $bannerid); $entityId = OA_Permission::getEntityId(); $entityType = 'advertiser_id'; $aOtherCampaigns = Admin_DA::getPlacements(array($entityType => $entityId)); $aOtherBanners = Admin_DA::getAds(array('placement_id' => $campaignid), false); $advertiserId = $aEntities['clientid']; $campaignId = $aEntities['campaignid']; $bannerId = $aEntities['bannerid']; $entityString = _getEntityString($aEntities);
<li><a href="homepage.php">Home</a></li> <li><a href="home.php">Search</a></li> <li><a href="showdata.php">Data</a></li> <li><a href="addcountry.php">Add the country</a></li> <li><a href="add.php">Add the player</a></li> <li><a href="delect.php">Delect the player</a></li> <li><a href="Data.php">Reset the database</a><li> </ul> </div> </div> <?php //Connect to the database. include 'connect.inc.php'; if (isset($_POST['submit'])) { processForm($connection); } else { showForm($connection); } function showForm($connection) { echo "<form action ='delect.php' method='POST'>"; echo "<fieldset>"; echo "<legend> Delect the Rugby Player</legend>"; echo "<table>"; echo "<tr><th>Delect</th><th>First Name</th><th>Last Name</th><th>Image</th><th>Position</th><th>Country Name</th></tr>"; //Select statement. $queryString = "SELECT tblRugbyPlayer.ID, tblRugbyPlayer.FirstName, tblRugbyPlayer.LastName, tblRugbyPlayer.Image, tblRugbyPlayer.Position, tblCountry.CountryName FROM tblRugbyPlayer JOIN tblCountry WHERE tblRugbyPlayer.CountryCode = tblCountry.CountryCode"; $result = mysqli_query($connection, $queryString); while ($row = mysqli_fetch_assoc($result)) { echo "<tr>";
</head> <body> <?php $servername = "localhost"; $username = "******"; $password = ""; $dbname = "getaddress"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } if (isset($_POST['update'])) { processForm($conn); } else { showForm($conn); } function processForm($conn) { $name = $_POST['user']; $message = $_POST['message']; $stripmessage = strip_tags($message); $messagefresh = preg_replace('/[^A-Za-z0-9_ -\\.]/', '', $stripmessage); // update data in mysql database $sql = "UPDATE usermac SET message='{$messagefresh}' WHERE username='******'" or die("this"); $result = mysqli_query($conn, $sql) or die("this stuffedup"); echo "{$messagefresh} added for {$name}"; } ?>