当前位置: 首页>>代码示例>>PHP>>正文


PHP Message::addMessage方法代码示例

本文整理汇总了PHP中Message::addMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Message::addMessage方法的具体用法?PHP Message::addMessage怎么用?PHP Message::addMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Message的用法示例。


在下文中一共展示了Message::addMessage方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkFields

function checkFields($data)
{
    $persons = new Person();
    $message = new Message();
    if (!isset($data["login"]) || empty($data["login"])) {
        $message->addMessage("Не заполнено поле \"Login\" ");
    } else {
        $pattern = "/^[a-zA-Z]+\\w{3,}\$/";
        if (!preg_match($pattern, $data["login"])) {
            $message->addMessage("Не верно заполнено поле \"login\"");
        } else {
            if ($login = $persons->checkUser($data["login"])) {
                $message->addMessage(" Пользователь {$login} есть в базе данных ");
            }
        }
    }
    if (!isset($data["email"]) || empty($data["email"])) {
        $message->addMessage("Не заполнено поле \"email\" ");
    } else {
        $pattern = "/^[a-zA-Z]+\\w{3,}+\\@+\\w{3,}+\\.+\\w{2,4}\$/";
        if (!preg_match($pattern, $data["email"])) {
            $message->addMessage("Не верно заполнено поле \"email\"");
        } else {
            if ($login = $persons->checkEmail($data["email"])) {
                $message->addMessage(" Такой email уже закреплен за пользователем {$login}");
            }
        }
    }
    if (!isset($data["pass"]) || empty($data["pass"])) {
        $message->addMessage("Не заполнено поле \"pass\"  ");
    }
    if (!isset($data["re_pass"]) || empty($data["re_pass"])) {
        $message->addMessage(" Не заполнено поле \"re_pass\"");
    } else {
        $pattern = "/^\\w{6,}\$/";
        if (!preg_match($pattern, $data["re_pass"]) || !preg_match($pattern, $data["pass"])) {
            $message->addMessage("недопустимые символы в pass/re_pass , или длинна пароля меньше 6 символов  ");
        } else {
            if ($data["re_pass"] != $data["pass"]) {
                $message->addMessage("Пароли не совпадают");
            }
        }
    }
    $message->printMessage();
}
开发者ID:andxbes,项目名称:wingoHW12,代码行数:45,代码来源:formsChecker.php

示例2: Message

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Messages</title>
        <!-- Latest compiled and minified CSS -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

        <!-- Optional theme -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <div class="bg-primary message-box">
        <?php 
include './models/IMessage.php';
include './models/Message.php';
$message = new Message();
$message->addMessage('test', 'my test message');
var_dump($message instanceof IMessage);
?>
        </div>
    </body>
</html>
开发者ID:jmorriseau,项目名称:PHPAdvClassFall2015,代码行数:24,代码来源:testMessage.php

示例3: messages

 function messages()
 {
     if ($_POST) {
         Funcs::escapePost();
         Message::addMessage(Funcs::$uri[2], $_POST['message']);
         $this->redirect('/cabinet/messages/' . Funcs::$uri[2] . '/');
     }
     if ($_GET['del']) {
         Funcs::escapeGet();
         Message::delMessage($_GET['del']);
         $this->redirect('/cabinet/messages/' . Funcs::$uri[2] . '/');
     }
     if (is_numeric(Funcs::$uri[2])) {
         $seo['seo_title'] = 'Сообщения';
         Funcs::setMeta($seo);
         $data = Message::getList(Funcs::$uri[2]);
         View::render('cabinet/messagesOne', $data);
     } else {
         $seo['seo_title'] = 'Сообщения';
         Funcs::setMeta($seo);
         $data['list'] = Message::getUsers();
         View::render('cabinet/messages', $data);
     }
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:24,代码来源:CabinetController.php

示例4: removeAllMessages

 public function removeAllMessages($key)
 {
     parent::addMessage($key, $msg);
     $this->setFlashMessage();
 }
开发者ID:JMCcartney77,项目名称:PHPAdvancedClassFall2015,代码行数:5,代码来源:FlashMessage.php

示例5: getUid

<?php

$base = "../../../";
require_once $base . "functions.php";
require_once $base . "loginCheck.php";
header('Content-type: text/html; charset=UTF-8');
$uid = getUid();
$hash = getCookieHash();
checkCookieHash($uid, $hash);
//uid, ruid, hash, message
if (!isset($_POST["ruid"]) && !isset($_POST["message"])) {
    add_return_data(0, 5, "ruid and message are must.");
}
if (!$_POST["ruid"] && !$_POST["message"]) {
    add_return_data(0, 6, "ruid and message can't be empty.");
}
$ruid = $_POST["ruid"];
$message = $_POST["message"];
$msg = new Message();
$retVal = $msg->addMessage($uid, $hash, $ruid, $message);
if ($retVal == 4 || $retVal == 3) {
    add_return_data(0, 7, "Receiver not found");
}
if ($retVal == 1) {
    add_return_data(1, 2, "Success sending message.");
}
add_return_data(0, 8, "Failure while sending.");
开发者ID:117n-n711,项目名称:pjmgmt,代码行数:27,代码来源:index.php

示例6: addMessage

 public function addMessage($key, $msg)
 {
     parent::addMessage($key, $msg);
     $this->setFlashMessages();
 }
开发者ID:aajoelljohnston,项目名称:PHPAdvClassFall2015,代码行数:5,代码来源:FlashMessage.php

示例7: Message

session_start();
require_once '../classes/connection.class.php';
require_once '../classes/message.class.php';
$addmessageobj = new Message();
/*echo '<pre>';
print_r($addmessageobj);
echo '</pre>';
exit;
*/
$visitor_id = mysqli_real_escape_string($addmessageobj->conxn, $_POST['visitor_id']);
$visitor_name = mysqli_real_escape_string($addmessageobj->conxn, $_POST['visitor_name']);
$visitor_email = mysqli_real_escape_string($addmessageobj->conxn, $_POST['visitor_email']);
$visitor_message = mysqli_real_escape_string($addmessageobj->conxn, $_POST['visitor_message']);
$addmessageobj->setVisitorID($visitor_id);
$addmessageobj->setVisitorName($visitor_name);
$addmessageobj->setVisitorEmail($visitor_email);
$addmessageobj->setVisitorMessage($visitor_message);
//$adduserobj->setError($er);
//$adduserobj->setMessage($msg);
$addmessageobj->addMessage();
/*echo '<pre>';
print_r ($addmessageobj);
echo '</pre>';
exit;*/
if ($addmessageobj) {
    header('location:../../rms/contact.php');
    $_SESSION['msg'] = $addmessageobj->msg = "Thanks, you have successfully sent your message";
} else {
    echo $_SESSION['msg'] = $addmessageobj->msg = "Sorry the message has not been  added, please try again later";
}
开发者ID:Ukesh2010,项目名称:aila,代码行数:30,代码来源:process_add_message.php

示例8: Message

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php 
include './models/IMessage.php';
include './models/Message.php';
$message = new Message();
$message->addMessage('test', 'this is my test msg!');
var_dump($message->getAllMessages());
echo '<br/>';
var_dump($message instanceof Imessage);
echo '<br/>';
var_dump($message->removeMessage('test'));
echo '<br/>';
?>
    </body>
</html>
开发者ID:jgrizzel,项目名称:PHPAdvClassFall2015,代码行数:26,代码来源:testMessages.php

示例9: implode

        // forward errors to stdout in order to see them in output
        $cmd = implode(' ', $execute) . ' 2>&1';
        $process = proc_open($cmd, $descriptorspec, $pipes, PATH_FS_TMP, $env);
        if (is_resource($process)) {
            //fwrite( $pipes[0], $encryptionKey );
            fclose($pipes[0]);
            $output = stream_get_contents($pipes[1]);
            $error = stream_get_contents($pipes[2]);
            fclose($pipes[1]);
            fclose($pipes[2]);
            // it's important to close all pipes before doing
            // a proc_close in order to prevent dead locks
            $return = proc_close($process);
        }
        if ($return === 0) {
            $message->addMessage('Knock send successfully to "' . $target . '". With correct settings, you should be able to access the server for a limited time now.');
        } else {
            if (!empty($output) && !empty($error)) {
                $output .= "\n{$error}";
            }
            $output = preg_replace("(\n\$)", '', $output);
            $message->addError('Unable to execute fwknop. It says: "' . str_replace("\n", "<br />\n", htmlspecialchars($output) . '".'));
        }
        if ($ERRORS_VERBOSE) {
            $message->addMessage('Command:<br />' . htmlspecialchars(str_replace($encryptionKey, '****', $cmd)) . '<br /><br />Output:<br />' . str_replace("\n", "<br />\n", htmlspecialchars($output)));
        }
    }
}
#############################################################################
###	VIEW
#############################################################################
开发者ID:aselvan,项目名称:PHPKnock,代码行数:31,代码来源:index.php

示例10: addMessage

 public function addMessage($key, $msg)
 {
     parent::addMessage($key, $msg);
     $_SESSION['flashmessages'] = $this->message;
 }
开发者ID:adflint,项目名称:PHPAdvClassFall2015,代码行数:5,代码来源:FlashMessage.php

示例11: sendmessage

 function sendmessage()
 {
     if ($_SESSION['iuser']) {
         Funcs::escapePost();
         Message::addMessage($_POST['touser'], $_POST['message']);
         View::$layout = 'popup';
         View::render('popup/loginclose');
     }
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:9,代码来源:PopupController.php

示例12: trimAll

<?php

require_once "../config/Autoload.php";
require_once "../libs/datafilter.php";
if (isset($_POST['text'])) {
    $_POST = trimAll($_POST);
    $_POST = htmlAll($_POST);
    $message = Message::addMessage($_POST['user_name'], $_POST['date'], $_POST['text']);
    if ($message == true) {
        echo 'Added successfully';
    } else {
        echo 'Please try again';
    }
}
if (isset($_POST['text_edit'])) {
    $_POST = trimAll($_POST);
    $_POST = htmlAll($_POST);
    $edit_message = Message::editMessage($_POST['message_edit_id'], $_POST['text_edit']);
    if ($edit_message == true) {
        echo 'Added successfully';
    } else {
        echo 'Please try again';
    }
}
开发者ID:capons,项目名称:lightit,代码行数:24,代码来源:message.php


注:本文中的Message::addMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。