本文整理汇总了PHP中System::Redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP System::Redirect方法的具体用法?PHP System::Redirect怎么用?PHP System::Redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System
的用法示例。
在下文中一共展示了System::Redirect方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mysql_errno
}
if ($_POST["attempt"] != null && $_POST["name"] != null && $_POST["title"] != null) {
// Create the page in the database
if ($validation_result_name == null) {
if (!Page::Create($_POST["name"], $_POST["title"], $_POST["description"])) {
$errno = mysql_errno();
$error = mysql_error();
$page = new PsychaticaErrorPage();
$page->ErrorCode = $errno;
$page->ErrorDescription = $error;
$page->ReturnButtonURL = "~/community/pages/create.mmo";
$page->ReturnButtonText = "Return to Create a Page";
$page->Render();
return;
}
System::Redirect("~/community/pages/" . $_POST["name"]);
return;
}
}
$page = new PsychaticaWebPage("Create a Page");
$page->BeginContent();
?>
<div class="Panel">
<h3 class="PanelTitle">Page Properties</h3>
<div class="PanelContent">
<form action="create.mmo" method="POST">
<input type="hidden" name="attempt" value="1" />
<table style="margin-left: auto; margin-right: auto;">
<tr>
<td><label for="txtPageName">Page <u>n</u>ame:</label></td>
<td><input type="text" id="txtPageName" name="name" accesskey="n" style="width: 100%"<?php
示例2: switch
<?php
if (count($path) > 1 && $path[1] != "") {
if (StringMethods::EndsWith($path[1], ".mmo")) {
switch ($path[1]) {
case "create.mmo":
require "Pages/Create.inc.php";
return;
default:
System::Redirect("~/community/pages");
return;
}
} else {
require "Pages/Detail.inc.php";
}
} else {
require "Pages/Browse.inc.php";
}
return;
示例3: PsychaticaErrorPage
return;
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
global $MySQL;
$thisuser->Block($_POST["block_reason"], $_POST["block_reason_hide"] == "1");
if ($_POST["report"] == "1") {
$thisuser->Report();
}
if ($MySQL->errno != 0) {
$page = new PsychaticaErrorPage();
$page->ErrorCode = mysql_errno();
$page->ErrorDescription = mysql_error();
$page->Render();
return;
}
System::Redirect("~/community/members/" . $thisuser->ShortName);
} else {
$page = new PsychaticaWebPage();
$page->Title = "Block User";
$page->BeginContent();
?>
<div class="Panel">
<h3 class="PanelTitle">Block <?php
echo $thisuser->LongName;
?>
</h3>
<div class="PanelContent">
<form action="block" method="POST">
<p>
Are you sure you wish to block <?php
echo $thisuser->LongName;
示例4: PsychaticaErrorPage
}
if ($_POST["attempt"] != null && $_POST["topic_name"] != null) {
$validate_topic_name = GroupTopic::ValidateName($_POST["topic_name"]);
}
if ($validate_topic_name == null && $_POST["attempt"] != null && $_POST["topic_name"] != null && $_POST["topic_title"] != null) {
$result = GroupTopic::Create($thisgroup, $_POST["topic_name"], $_POST["topic_title"], $_POST["topic_description"]);
if (!$result) {
$page = new PsychaticaErrorPage();
$page->ErrorCode = mysql_errno();
$page->ErrorDescription = mysql_error();
$page->ReturnButtonURL = "~/community/groups/" . $thisgroup->Name . "/topics/create.mmo";
$page->ReturnButtonText = "Return to Create Topic";
$page->Render();
return;
}
System::Redirect("~/community/groups/" . $thisgroup->Name . "/topics/" . $_POST["topic_name"]);
return;
}
$page = new PsychaticaWebPage("Create Topic | " . $thisgroup->Title);
$page->BeginContent();
?>
<div class="Panel">
<h3 class="PanelTitle">Topic Properties</h3>
<div class="PanelContent">
<form action="create.mmo" method="POST">
<p>
Topic name and title must be 50 characters or less. Name must be alphanumeric
characters only with no spaces.
</p>
<input type="hidden" name="attempt" value="1" />
<table style="margin-left: auto; margin-right: auto;">
示例5:
<?php
if ($journal->Creator->ID != $CurrentUser->ID) {
System::Redirect("~/community/members/" . $thisuser->ShortName . "/journals/" . $journal->Name . "/entries/" . $entry->Name);
return;
}
?>
<div class="ProfilePage">
<div class="ProfileTitle">
<span class="ProfileUserName"><?php
echo $entry->Title;
?>
</span>
<span class="ProfileControlBox"><a href="/community/members/<?php
echo $thisuser->ShortName;
?>
/journals/<?php
echo $journal->Name;
?>
/entries/<?php
echo $entry->Name;
?>
">Back to Journal Entry</a></span>
</div>
<div class="ProfileContentSection">
<div class="Panel">
<h3 class="PanelTitle">Impressions</h3>
<div class="PanelContent">
<table style="margin-left: auto; margin-right: auto;">
<tr>
<th>Member</th>
示例6: readfile
// header("Content-Type: " . mime_content_type($fileName));
if (file_exists($fileName)) {
readfile($fileName);
}
return;
}
break;
}
break;
case "connect":
$thispage->AddMember($CurrentUser);
System::Redirect("~/community/pages/" . $thispage->Name);
return;
case "disconnect":
$thispage->RemoveMember($CurrentUser);
System::Redirect("~/community/pages/" . $thispage->Name);
return;
default:
$page = new PsychaticaWebPage($thispage->Title);
$page->BeginContent();
$actions = $thispage->GetActions();
?>
<div class="Panel">
<h3 class="PanelTitle"><?php
echo $thispage->Title;
?>
</h3>
<div class="PanelContent">
<div class="ProfilePage">
<div class="ProfileTitle">
<span class="ProfileUserName"><?php
示例7: PsychaticaErrorPage
<?php
if ($thisgroup->Creator->ID != $CurrentUser->ID) {
$errorPage = new PsychaticaErrorPage();
$errorPage->Message = "You must be the group creator to perform this action.";
$errorPage->ReturnButtonURL = "~/community/groups/" . $thisgroup->Name;
$errorPage->ReturnButtonText = "Return to Group";
$errorPage->Render();
return;
} else {
if ($_POST["confirm"] == "1") {
$thisgroup->Delete();
System::Redirect("~/community/groups");
} else {
$page = new PsychaticaWebPage();
$page->BeginContent();
?>
<form action="delete.phnx" method="POST">
<input type="hidden" name="confirm" value="1" />
<div class="Panel">
<h3 class="PanelTitle">Are you sure you want to delete this group?</h3>
<div class="PanelContent">
<p><?php
echo $thisgroup->Title;
?>
</p>
<p>If you delete this group, you will not be able to recover any of its content, including topics and comments.</p>
<p style="text-align: center;"><input type="submit" value="Delete Group" /> <a class="Button" href="<?php
echo System::ExpandRelativePath("~/community/groups/" . $thisgroup->Name);
?>
">Cancel</a></p>
示例8: PsychaticaErrorPage
if ($_POST["attempt"] != null && $_POST["entry_name"] != null) {
$validate_entry_name = JournalEntry::ValidateName($_POST["entry_name"]);
}
if ($validate_entry_name == null && $_POST["attempt"] != null && $_POST["entry_name"] != null && $_POST["entry_title"] != null) {
$result = $journal->CreateEntry($_POST["entry_name"], $_POST["entry_title"], $_POST["entry_content"]);
if (!$result) {
$page = new PsychaticaErrorPage();
$page->Message = "A database error occurred.";
$page->ErrorCode = mysql_errno();
$page->ErrorDescription = mysql_error();
$page->ReturnButtonURL = "~/community/members/" . $thisuser->Name . "/journals/" . $journal->Name . "/entries/create.mmo";
$page->ReturnButtonText = "Return to " . mysql_error() . "Create an Entry";
$page->Render();
return;
}
System::Redirect("~/community/members/" . $thisuser->ShortName . "/journals/" . $journal->Name . "/entries/" . $_POST["entry_name"]);
return;
}
/*
$page = new PsychaticaWebPage("Create Entry | " . $journal->Name . " | " . $thisuser->LongName . "'s Journal");
$page->BeginContent();
*/
?>
<div class="Panel">
<h3 class="PanelTitle">Journal Entry Properties</h3>
<div class="PanelContent">
<form action="create.mmo" method="POST">
<p>
Entry name and title must be 50 characters or less. Name must be alphanumeric
characters only with no spaces.
</p>
示例9: PsychaticaWebPage
<?php
if (!System::$Configuration["Bank.Enabled"]) {
System::Redirect("~/market");
return;
}
$page = new PsychaticaWebPage("Bank");
$page->BeginContent();
?>
<p>
Welcome to the <?php
echo System::$Configuration["Application.Name"];
?>
Bank. Here you can deposit or withdraw Resources
for a nominal fee. Resources will be stored in the Vault, where they will accrue interest at the rates described below. Items
will be stored in the Safe Deposit Box.
</p>
<p>
Please note that not all resources can be stored in the Bank. If the resource does not appear in the table below, then it cannot
be stored in the bank.
</p>
<table style="width: 100%">
<tr>
<td style="width: 25%">
<div class="ActionList">
<a id="lnkInformation" href="<?php
echo System::$Configuration["Application.BasePath"];
?>
/market/bank" onclick="SwitchTab('tabInformation', 'lnkInformation'); return false;" <?php
if ($path[1] == "") {
echo "class=\"Selected\"";
示例10:
<input type="submit" value="Delete Comment" />
</form>
<a class="Button" href="/community/groups/<?php
echo $thisgroup->Name;
?>
/topics/<?php
echo $topic->Name;
?>
">Cancel</a>
</div>
</div>
<?php
} else {
$id = $path[5];
$topic->RemoveComment($id);
System::Redirect("~/community/groups/" . $thisgroup->Name . "/topics/" . $topic->Name);
return;
}
} else {
if (count($path) > 4 && $path[4] == "comment.mmo" || count($path) > 6 && $path[6] == "edit.mmo") {
?>
<h3 class="PanelTitle">Leave a comment</h3>
<div class="PanelContent">
<form action="/community/groups/<?php
echo $thisgroup->Name;
?>
/topics/<?php
echo $topic->Name;
?>
/comment.mmo" method="POST">
<table style="width: 100%">
示例11: PsychaticaErrorPage
if ($_POST["attempt"] != null && $_POST["name"] != null) {
$validation_result_name = Forum::ValidateName($_POST["name"]);
}
if ($_POST["attempt"] != null && $_POST["name"] != null && $_POST["title"] != null) {
// Create the group in the database
if ($validation_result_name == null) {
if (!Forum::Create($_POST["name"], $_POST["title"], $_POST["description"], $CurrentUser)) {
$page = new PsychaticaErrorPage();
$page->ErrorCode = mysql_errno();
$page->ErrorDescription = mysql_error();
$page->ReturnButtonURL = "~/community/forums/create.mmo";
$page->ReturnButtonText = "Return to Create a Forum";
$page->Render();
return;
}
System::Redirect("~/community/forums/" . $_POST["name"]);
return;
}
}
$page = new PsychaticaWebPage("Create a Forum");
$page->BeginContent();
?>
<div class="Panel">
<h3 class="PanelTitle">Forum Properties</h3>
<div class="PanelContent">
<form action="create.mmo" method="POST">
<input type="hidden" name="attempt" value="1" />
<table style="margin-left: auto; margin-right: auto;">
<tr>
<td><label for="txtTitle">Forum <u>t</u>itle:</label></td>
<td><input type="text" id="txtTitle" name="title" accesskey="t" onkeyup="AutoGenerateName('txtTitle', 'txtName');" style="width: 100%"<?php
示例12: PsychaticaErrorPage
if ($_POST["attempt"] != null && $validated_journal_name == null && $_POST["journal_title"] != null) {
$result = Journal::Create($_POST["journal_name"], $_POST["journal_title"], $_POST["journal_description"]);
if (!$result) {
$page = new PsychaticaErrorPage();
$page->BeginContent();
?>
<h1>Error</h1>
<p><?php
echo mysql_errno() . ": " . mysql_error();
?>
</p>
<?php
$page->EndContent();
return;
} else {
System::Redirect("~/community/members/" . $thisuser->ShortName . "/journals/" . $_POST["journal_name"]);
return;
}
}
?>
<div class="ProfilePage">
<?php
$journals = Journal::GetByUser($thisuser);
?>
<div class="Panel">
<h3 class="PanelTitle">Journal Properties</h3>
<div class="PanelContent">
<form action="create.mmo" method="POST">
<input type="hidden" name="attempt" value="1" />
<table style="margin-left: auto; margin-right: auto;">
<tr>