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


PHP misc::back方法代码示例

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


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

示例1: foreach

                    $errors[] = "Password [new] too long";
                }
                if (strlen($_POST['password_new']) < 6) {
                    $errors[] = "Passwrod [new] too short";
                }
                if ($_POST['password_new'] !== $_POST['password_new_confirm']) {
                    $errors[] = "New Passwords does not match!.";
                }
                if (count($errors) > 0) {
                    foreach ($errors as $nElement) {
                        echo $nElement . ".<br/>";
                    }
                    misc::back();
                } else {
                    //verify
                    if (user::RestorePass($_GET['uid'], $_POST['password_new'])) {
                        echo "Password changed successfully. <br/>";
                        misc::redirect('?pg=news', 1);
                    } else {
                        echo "Invalid old password specified.<br/>";
                        misc::back();
                    }
                }
            } else {
                core::$ucp->ForgotpwForm();
            }
        }
    }
} else {
    echo 'Entry is invalid.';
}
开发者ID:EbrahemS,项目名称:SRCMS,代码行数:31,代码来源:cpw.php

示例2: sendWebPrivMsg

 public static function sendWebPrivMsg($to, $from, $title, $text)
 {
     global $core;
     $msgTitle = security::toHTML($title);
     $msgText = security::toHTML($text);
     $senderJID = user::accountJIDbyUsername($from);
     $receiverJID = user::accountJIDbyUsername($to);
     if ($senderJID != $receiverJID) {
         if (core::$sql->numRows("select * from srcms_privatemessages where receiver='{$receiverJID}'") >= $core->aConfig['maxPrivMsg']) {
             echo "Receiver inbox is full.<br/>";
         } else {
             if (strlen($msgTitle) < $core->aConfig['minPrivMsgTitleLen'] || strlen($msgTitle) > $core->aConfig['maxPrivMsgTitleLen'] || strlen($msgText) < $core->aConfig['minPrivMsgBodyLen'] || strlen($msgText) > $core->aConfig['maxPrivMsgBodyLen']) {
                 echo "Message text, or title is too long or too short. Minimum title length is " . $core->aConfig['minPrivMsgTitleLen'] . " and " . $core->aConfig['maxPrivMsgTitleLen'] . "symbols\r\n\t\t\t\t\t\t\t\tmaximum. Message content minimum length is " . $core->aConfig['minPrivMsgBodyLen'] . " and " . $core->aConfig['maxPrivMsgBodyLen'] . " symbols maximum.<br/>";
                 misc::back();
             } else {
                 $datetime = misc::getDateTime();
                 core::$sql->exec("insert into srcms_privatemessages(sender,receiver, title, msg, viewed, time) values('{$senderJID}', '{$receiverJID}', '{$msgTitle}', '{$msgText}', '0', '{$datetime}')");
                 echo "<br/>Message sent.<br/>";
                 misc::redirect("?pg=ucp&act=mailbox", 2);
             }
         }
     } else {
         echo "You can't send message to yourself.<br/>";
         misc::back();
     }
 }
开发者ID:EbrahemS,项目名称:SRCMS,代码行数:26,代码来源:user.class.php


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