本文整理汇总了PHP中WebPage::messageBox方法的典型用法代码示例。如果您正苦于以下问题:PHP WebPage::messageBox方法的具体用法?PHP WebPage::messageBox怎么用?PHP WebPage::messageBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebPage
的用法示例。
在下文中一共展示了WebPage::messageBox方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Advert
break;
default:
$advertObj->{$postVar} = filter_input(INPUT_POST, $postVar) ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, $postVar)) : '';
if ($advertObj->{$postVar} === "") {
array_push($errorArr, "Please enter {$postVar} ");
}
break;
}
}
//If validated and not empty submit it to database
if (count($errorArr) < 1) {
$uploadOk = 1;
$msg = '';
if ($uploadOk == 1 && move_uploaded_file($_FILES["background"]["tmp_name"], MEDIA_FILES_PATH . $advertObj->background) && move_uploaded_file($_FILES["zoneOne"]["tmp_name"], MEDIA_FILES_PATH . $advertObj->zoneOne) && move_uploaded_file($_FILES["zoneOneAlt"]["tmp_name"], MEDIA_FILES_PATH . $advertObj->zoneOneAlt) && move_uploaded_file($_FILES["zoneTwo"]["tmp_name"], MEDIA_FILES_PATH . $advertObj->zoneTwo) && move_uploaded_file($_FILES["zoneTwoAlt"]["tmp_name"], MEDIA_FILES_PATH . $advertObj->zoneTwoAlt) && move_uploaded_file($_FILES["zoneThree"]["tmp_name"], MEDIA_FILES_PATH . $advertObj->zoneThree)) {
if ($advertObj->add($dbObj) === 'success') {
$msg = $thisPage->messageBox('Advert successfully added.', 'success');
} else {
$msg = $thisPage->messageBox('Advert addition failed.', 'error');
}
}
} else {
$msg = $thisPage->showError($errorArr);
}
//Else show error messages
}
//Advert Deletion Handler
if (filter_input(INPUT_POST, "delete-advert") !== NULL) {
$advertToDel = new Advert();
//Instantiate post class
$advertToDel->id = filter_input(INPUT_POST, 'hidden-advert-id') ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, 'hidden-advert-id', FILTER_VALIDATE_INT)) : '';
if (filter_input(INPUT_POST, 'hidden-advert-id') === "") {
示例2: array
$errorArr = array();
//Array of errors
$dbObj = new Database();
$userObj = new User();
//User Deletion Handler
if (filter_input(INPUT_POST, "delete-user") !== NULL) {
$userToDel = new User();
//Instantiate user class
$userToDel->id = filter_input(INPUT_POST, 'hidden-user-id') ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, 'hidden-user-id', FILTER_VALIDATE_INT)) : '';
if (filter_input(INPUT_POST, 'hidden-user-id') === "") {
array_push($errorArr, "Illegal Operation.");
}
//If validated and not empty submit it to database
if (count($errorArr) < 1) {
if ($userToDel->delete($dbObj, 'users') === 'success') {
$msg = $thisPage->messageBox('User successfully deleted.', 'success');
} else {
$msg = $thisPage->messageBox('User deletion failed.', 'error');
}
} else {
$msg = $thisPage->showError($errorArr);
}
}
//Admin Role Changer button click handler
if (filter_input(INPUT_POST, "upgrade-user") !== NULL) {
if (filter_input(INPUT_POST, 'hidden-user-id') === "") {
array_push($errorArr, "Illegal operation parameter 1.");
}
if (filter_input(INPUT_POST, 'hidden-user-role') === "") {
array_push($errorArr, "Illegal operation parameter 2.");
}
示例3:
array_push($errorArr, "Please enter {$postVar} ");
}
}
break;
default:
$thisUser->{$postVar} = filter_input(INPUT_POST, $postVar) ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, $postVar)) : '';
if (filter_input(INPUT_POST, $postVar) === "") {
array_push($errorArr, "Please enter {$postVar} ");
}
break;
}
}
//If validated and not empty submit it to database
if (count($errorArr) < 1) {
if ($thisUser->update($dbObj, 'users') === 'success') {
$msg = $thisPage->messageBox('Profile successfully updated.', 'success');
} else {
$msg = $thisPage->messageBox('Profile update failed.', 'error');
}
} else {
$msg = $thisPage->showError($errorArr);
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Edit Profile</title>
示例4: d
$emailAddress = COMPANY_EMAIL;
//iadet910@iadet.net
if (empty($subject)) {
$subject = "Message From: {$name}";
}
$transport = Swift_MailTransport::newInstance();
$message = Swift_Message::newInstance();
$message->setTo(array($emailAddress => "TSI Limited Admin"));
$message->setSubject($subject);
$message->setBody($body);
$message->setFrom($email, "Website Guest");
$message->setContentType("text/html");
$mailer = Swift_Mailer::newInstance($transport);
$mailer->send($message);
$msgStatus = 'success';
$msg = $thisPage->messageBox('Your message has been sent.', $msgStatus);
} else {
$msgStatus = 'error';
$msg = $thisPage->showError($errorArr);
}
}
?>
<!DOCTYPE html>
<html lang="en-US">
<head>
<?php
include 'includes/meta-tags.php';
?>
<script type="text/javascript"> window._wpemojiSettings = { "baseUrl":"http:\/\/s.w.org\/images\/core\/emoji\/72x72\/","ext":".png","source":{"concatemoji":"http:\/\/tsigroups.com\/tsi-new1\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.3.1"}}; !function(a,b,c){function d(a){var c=b.createElement("canvas"),d=c.getContext&&c.getContext("2d");return d&&d.fillText?(d.textBaseline="top",d.font="600 32px Arial","flag"===a?(d.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),c.toDataURL().length>3e3):(d.fillText(String.fromCharCode(55357,56835),0,0),0!==d.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g;c.supports={simple:d("simple"),flag:d("flag")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);</script>
<style type="text/css"> img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; } </style>
<link rel='stylesheet' id='rs-plugin-settings-css' href='plugins/revslider/public/assets/css/settings5bca.css?ver=5.0.4.1' type='text/css' media='all' />
示例5:
$emailAddress = COMPANY_EMAIL;
//iadet910@iadet.net
if (empty($subject)) {
$subject = "Message From: {$name}";
}
$transport = Swift_MailTransport::newInstance();
$message = Swift_Message::newInstance();
$message->setTo(array($emailAddress => WEBSITE_AUTHOR));
$message->setSubject($subject);
$message->setBody($body);
$message->setFrom($email, "Website Guest");
$message->setContentType("text/html");
$mailer = Swift_Mailer::newInstance($transport);
$mailer->send($message);
$msgStatus = 'success';
$msg = $thisPage->messageBox('Your message has been sent.', 'success');
} else {
$msgStatus = 'error';
$msg = $thisPage->showError($errorArr);
}
}
?>
<!DOCTYPE html>
<html lang="en-US">
<head>
<?php
include 'includes/meta-tags.php';
?>
<style type="text/css">img.wp-smiley,img.emoji {display: inline !important;border: none !important;box-shadow: none !important;height: 1em !important;width: 1em !important;margin: 0 .07em !important;vertical-align: -0.1em !important;background: none !important;padding: 0 !important; }</style>
<link rel='stylesheet' id='rs-plugin-settings-css' href='<?php
echo SITE_URL;
示例6: switch
array_push($errorArr, "Password Mismatch !!! ");
if (filter_input(INPUT_POST, $postVar) == "") {
array_push($errorArr, "Please confirm your password. ");
}
}
default:
if (filter_input(INPUT_POST, $postVar) == "") {
array_push($errorArr, "Please enter a {$postVar} ");
}
}
}
if (count($errorArr) < 1) {
$thisUser->password = mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, 'password1'));
$thisUser->id = $_SESSION['USERID'];
$newPassword = mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, 'password'));
switch ($thisUser->changePassword($dbObj, 'users', $newPassword)) {
case 'success':
$_SESSION['topmsg'] = $thisPage->messageBox('Password successfully changed.', 'success');
$thisPage->redirectTo($_SERVER['HTTP_REFERER']);
break;
case 'error':
$_SESSION['topmsg'] = $thisPage->messageBox('Password update failed. Please re-enter your details.', 'error');
$thisPage->redirectTo($_SERVER['HTTP_REFERER']);
break;
}
} else {
$_SESSION['topmsg'] = $thisPage->showError($errorArr);
$thisPage->redirectTo($_SERVER['HTTP_REFERER']);
}
//Display error messages
}
示例7:
array_push($errorArr, "Password mis-match.");
}
$newUser->{$postVar} = filter_input(INPUT_POST, $postVar) ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, $postVar)) : '';
break;
default:
$newUser->{$postVar} = filter_input(INPUT_POST, $postVar) ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, $postVar)) : '';
if (filter_input(INPUT_POST, $postVar) === "") {
array_push($errorArr, "Please enter {$postVar} ");
}
break;
}
}
//If validated and not empty submit it to database
if (count($errorArr) < 1) {
if ($newUser->add($dbObj, 'users') === 'success') {
$msg = $thisPage->messageBox('User successfully added.', 'success');
} else {
$msg = $thisPage->messageBox('User creation/addition failed.', 'error');
}
} else {
$msg = $thisPage->showError($errorArr);
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Create New User</title>
示例8: foreach
if (filter_input(INPUT_POST, "login") !== NULL) {
$postVars = ['username', 'password'];
// Login Form field names
foreach ($postVars as $postVar) {
$thisUser->{$postVar} = filter_input(INPUT_POST, $postVar) ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, $postVar)) : '';
if (filter_input(INPUT_POST, $postVar) == "") {
array_push($errorArr, "Please enter a {$postVar} ");
}
}
if (count($errorArr) < 1) {
switch ($thisUser->login($dbObj, 'users')) {
case 'success':
$thisPage->redirectTo('dashboard');
break;
case 'error':
$msg = $thisPage->messageBox('Login Failed. Please re-enter you login details.', 'error');
break;
}
} else {
$msg = $thisPage->showError($errorArr);
}
//Display error messages
}
//Logout Handler
if (!isset($_SESSION['LoggedIn']) && filter_input(INPUT_GET, base64_encode('loggedout')) !== NULL && filter_input(INPUT_POST, "login") === NULL) {
$msg = $thisPage->messageBox('You are now successfully logged out', 'success');
}
?>
<!DOCTYPE html>
<html lang="en">
示例9: array
if (count($errorArr) < 1) {
$emailAddress = COMPANY_EMAIL;
//iadet910@iadet.net
$subject = "Booking for " . $subject . " By {$name}";
$body = "<div><p><u><strong>Course Booking Information</strong></u></p>\r\n <p><strong>COURSE</strong>: {$subject}</p>\r\n <p><strong>USER NAME</strong>: {$name}</p>\r\n <p><strong>EMAIL: </strong> <a href='mailto:{$email}'>{$email}</a></p>\r\n <p><strong>PHONE NO: </strong> {$phone}</p>\r\n <p><strong>ADDRESS</strong>: {$address}</p>\r\n <p><strong>MESSAGE</strong>: {$body}</p>\r\n <p> </p>\r\n <p>Message sent from <a href='http://tsigroups.com/'>TSI Groups Limited Website</a></p>\r\n </div>";
$transport = Swift_MailTransport::newInstance();
$message = Swift_Message::newInstance();
$message->setTo(array($emailAddress => "TSI Limited Admin"));
$message->setSubject($subject);
$message->setBody($body);
$message->setFrom($email, $name);
$message->setContentType("text/html");
$mailer = Swift_Mailer::newInstance($transport);
$mailer->send($message);
$msgStatus = 'success';
$msg = $thisPage->messageBox('Your course booking message has been sent.', $msgStatus);
} else {
$msgStatus = 'error';
$msg = $thisPage->showError($errorArr);
}
}
//get the course id; if failed redirect to course-categories page
$thisCourseId = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT) ? filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT) : $thisPage->redirectTo('courses');
foreach ($courseObj->fetchRaw("*", " status = 1 AND id = {$thisCourseId} ") as $course) {
$courseData = array('id' => 'id', 'name' => 'name', 'code' => 'code', 'image' => 'image', 'media' => 'media', 'amount' => 'amount', 'shortName' => 'short_name', 'category' => 'category', 'startDate' => 'start_date', 'endDate' => 'end_date', 'description' => 'description', 'status' => 'status', 'currency' => 'currency');
foreach ($courseData as $key => $value) {
switch ($key) {
case 'image':
$courseObj->{$key} = MEDIA_FILES_PATH1 . 'course-image/' . $course[$value];
break;
case 'media':