本文整理匯總了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.';
}
示例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();
}
}