本文整理汇总了PHP中startHTML函数的典型用法代码示例。如果您正苦于以下问题:PHP startHTML函数的具体用法?PHP startHTML怎么用?PHP startHTML使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了startHTML函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activation
function activation($activation)
{
global $user;
global $db;
global $noerrors;
include 'functions/functions.php';
if ($noerrors != 0) {
echo json_encode(array("result" => "failed", "message" => "Database Connection"));
return;
}
// JSON Message array
$jsonArray = array();
$findActivation = $db->prepare("SELECT * FROM `hash_codes` WHERE `type` = 'activation' AND `code` = :activationCode");
$findActivation->bindParam(':activationCode', $activation);
$findActivation->execute();
if ($findActivation->rowCount() == 1) {
$codeData = $findActivation->fetch();
$userID = $codeData['userID'];
$code = $codeData['code'];
// Start transaction
$db->beginTransaction();
$sqlErrors = 0;
// Make User Active
$userActive = $db->prepare("UPDATE `users` SET `active` = '1' WHERE `userID` = :userID");
$userActive->bindParam(':userID', $userID);
if (!$userActive->execute()) {
$sqlErrors++;
}
// Remove Hash Code
$removeCode = $db->prepare("DELETE FROM `hash_codes` WHERE `code` = :hashCode");
$removeCode->bindParam(':hashCode', $code);
if (!$removeCode->execute()) {
$sqlErrors++;
}
if ($sqlErrors == 0) {
$db->commit();
startHTML('Account Activated', false);
echo '<div style="text-align:center;"><h2>Account Activated</h2></div>';
footerHTML();
return;
} else {
$db->rollBack();
startHTML('Account Activated', false);
echo '<div style="text-align:center;"><h2>Sorry an error occurred</h2></div>';
footerHTML();
return;
}
} else {
startHTML('Account Activated', false);
echo '<div style="text-align:center;"><h2>Sorry this activation code doesn\'t exist or has expired</h2></div>';
footerHTML();
return;
}
}
示例2: runWWWVersion
/**
* Processes loading of this sample code through a web browser.
*/
function runWWWVersion()
{
session_start();
// Note that all calls to endHTML() below end script execution!
global $_SESSION, $_GET;
if (!isset($_SESSION['docsSampleSessionToken']) && !isset($_GET['token'])) {
requestUserLogin('Please login to your Google Account.');
} else {
$client = getAuthSubHttpClient();
$docs = new Zend_Gdata_Docs($client);
// First we check for commands that can be submitted either though
// POST or GET (they don't make any changes).
if (!empty($_REQUEST['command'])) {
switch ($_REQUEST['command']) {
case 'retrieveAllDocuments':
startHTML();
retrieveAllDocuments($docs, true);
endHTML(true);
case 'retrieveWPDocs':
startHTML();
retrieveWPDocs($docs, true);
endHTML(true);
case 'retrieveSpreadsheets':
startHTML();
retrieveSpreadsheets($docs, true);
endHTML(true);
case 'fullTextSearch':
startHTML();
fullTextSearch($docs, true, $_REQUEST['query']);
endHTML(true);
}
}
// Now we handle the potentially destructive commands, which have to
// be submitted by POST only.
if (!empty($_POST['command'])) {
switch ($_POST['command']) {
case 'uploadDocument':
startHTML();
uploadDocument($docs, true,
$_FILES['uploadedFile']['name'],
$_FILES['uploadedFile']['tmp_name']);
endHTML(true);
case 'modifySubscription':
if ($_POST['mode'] == 'subscribe') {
startHTML();
endHTML(true);
} elseif ($_POST['mode'] == 'unsubscribe') {
startHTML();
endHTML(true);
} else {
header('HTTP/1.1 400 Bad Request');
startHTML();
echo "<h2>Invalid mode.</h2>\n";
echo "<p>Please check your request and try again.</p>";
endHTML(true);
}
}
}
// Check for an invalid command. If so, display an error and exit.
if (!empty($_REQUEST['command'])) {
header('HTTP/1.1 400 Bad Request');
startHTML();
echo "<h2>Invalid command.</h2>\n";
echo "<p>Please check your request and try again.</p>";
endHTML(true);
}
// If a menu parameter is available, display a submenu.
if (!empty($_REQUEST['menu'])) {
switch ($_REQUEST['menu']) {
case 'list':
startHTML();
displayListMenu();
endHTML();
case 'query':
startHTML();
displayQueryMenu();
endHTML();
case 'upload':
startHTML();
displayUploadMenu();
endHTML();
case 'logout':
startHTML(false);
logout();
endHTML();
default:
header('HTTP/1.1 400 Bad Request');
startHTML();
echo "<h2>Invalid menu selection.</h2>\n";
echo "<p>Please check your request and try again.</p>";
//.........这里部分代码省略.........
示例3: error_reporting
error_reporting(E_ALL);
/*include database connection*/
require_once 'scripts/prepend.php';
// If user is not logged in redirect to index.php
if (!$user->userExists()) {
header('Location: index.php');
die;
}
if ($user->active) {
header('Location: dashboard.php');
die;
}
require_once 'scripts/functions/functions.php';
/* Start HTML*/
startHTML("Account Not Active", false);
?>
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/" style="height:auto;">
<h2>Managers Companion</h2>
</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
示例4: runWWWVersion
/**
* Processes loading of this sample code through a web browser.
*
* @return void
*/
function runWWWVersion()
{
session_start();
// Note that all calls to endHTML() below end script execution!
// Check to make sure that the user has set a password.
$p = LOGIN_PASSWORD;
if (empty($p)) {
startHTML(false);
displayPasswordNotSetNotice();
endHTML();
}
// Grab any login credentials that might be waiting in the request
if (!empty($_POST['password'])) {
if ($_POST['password'] == LOGIN_PASSWORD) {
$_SESSION['authenticated'] = 'true';
} else {
// Invalid password. Stop and display a login screen.
startHTML(false);
requestUserLogin("Incorrect password.");
endHTML();
}
}
// If the user isn't authenticated, display a login screen
if (!isset($_SESSION['authenticated'])) {
startHTML(false);
requestUserLogin();
endHTML();
}
// Try to login. If login fails, log the user out and display an
// error message.
try {
$client = getClientLoginHttpClient(GAPPS_USERNAME . '@' . GAPPS_DOMAIN, GAPPS_PASSWORD);
$gapps = new Zend_Gdata_Gapps($client, GAPPS_DOMAIN);
} catch (Zend_Gdata_App_AuthException $e) {
session_destroy();
startHTML(false);
displayAuthenticationFailedNotice();
endHTML();
}
// Success! We're logged in.
// First we check for commands that can be submitted either though
// POST or GET (they don't make any changes).
if (!empty($_REQUEST['command'])) {
switch ($_REQUEST['command']) {
case 'retrieveUser':
startHTML();
retrieveUser($gapps, true, $_REQUEST['user']);
endHTML(true);
case 'retrieveAllUsers':
startHTML();
retrieveAllUsers($gapps, true);
endHTML(true);
case 'retrieveNickname':
startHTML();
retrieveNickname($gapps, true, $_REQUEST['nickname']);
endHTML(true);
case 'retrieveNicknames':
startHTML();
retrieveNicknames($gapps, true, $_REQUEST['user']);
endHTML(true);
case 'retrieveAllNicknames':
startHTML();
retrieveAllNicknames($gapps, true);
endHTML(true);
case 'retrieveEmailLists':
startHTML();
retrieveEmailLists($gapps, true, $_REQUEST['recipient']);
endHTML(true);
case 'retrieveAllEmailLists':
startHTML();
retrieveAllEmailLists($gapps, true);
endHTML(true);
case 'retrieveAllRecipients':
startHTML();
retrieveAllRecipients($gapps, true, $_REQUEST['emailList']);
endHTML(true);
}
}
// Now we handle the potentially destructive commands, which have to
// be submitted by POST only.
if (!empty($_POST['command'])) {
switch ($_POST['command']) {
case 'createUser':
startHTML();
createUser($gapps, true, $_POST['user'], $_POST['givenName'], $_POST['familyName'], $_POST['pass']);
endHTML(true);
case 'updateUserName':
startHTML();
updateUserName($gapps, true, $_POST['user'], $_POST['givenName'], $_POST['familyName']);
endHTML(true);
case 'updateUserPassword':
startHTML();
updateUserPassword($gapps, true, $_POST['user'], $_POST['pass']);
endHTML(true);
case 'setUserSuspended':
//.........这里部分代码省略.........
示例5: processPageLoad
/**
* Processes loading of this sample code through a web browser. Uses AuthSub
* authentication and outputs a list of a user's base items if succesfully
* authenticated.
*
* @return void
*/
function processPageLoad()
{
global $_SESSION, $_GET;
if (!isset($_SESSION['sessionToken']) && !isset($_GET['token'])) {
requestUserLogin('Please login to your Google Account.');
} else {
startHTML();
$client = getAuthSubHttpClient();
$itemUrl = insertItem($client, false);
updateItem($client, $itemUrl, false);
listAllMyItems($client);
deleteItem($client, $itemUrl, true);
querySnippetFeed();
endHTML();
}
}
示例6: footerHTML
<a class="navbar-brand" href="/" style="height:auto;">
<h2>Managers Companion</h2>
</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
</div><!--/.nav-collapse -->
</div>
</nav>
<?php
echo '<div style="text-align:center;"><h2>Reset password code invalid</h2></div>';
footerHTML();
return;
}
startHTML('Reset Password', false);
?>
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/" style="height:auto;">
<h2>Managers Companion</h2>
</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
示例7: foreach
if ($newDocumentEntry !== null) {
$alternateLink = '';
foreach ($newDocumentEntry->link as $link) {
if ($link->getRel() === 'alternate') {
$alternateLink = $link->getHref();
}
}
header("Location: {$alternateLink}");
exit;
}
} catch (Zend_Gdata_App_HttpException $e) {
echo '<div class="error">' . '<b>Error processing document:</b><br>' . $e->getMessage() . "</div>";
exit(1);
}
}
startHTML();
switch (@$_REQUEST['command']) {
case 'logout':
logout();
break;
default:
if ($docs) {
displayUploadMenu();
}
}
endHTML();
} catch (Zend_Gdata_App_AuthException $e) {
echo '<div class="error">Error: Unable to authenticate. Please check your token.</div>';
exit(1);
}
function setupDocsClient($token = null)
示例8: startHTML
<?php
global $db;
startHTML('Page Not Found', false);
?>
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/" style="height:auto;">
<img src="/img/logo3.png" class="img-responsive">
</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="text-center">
<h2 class="text-center" style="font-size: 6em; color: rgb(41, 128, 185);">
<b>4</b><i class="fa fa-meh-o" style=" font-size:1.25em;"></i><b>4</b>
</h2>
<p>Sorry this page doesn't exist :(</p>
示例9: startHTML
<?php
global $db;
// Start HTML
startHTML("Add User", false);
?>
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/" style="height:auto;">
<h2>Managers Companion</h2>
</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="section white">
<div class="container">
<div class="col-md-12">
<h1>Register</h1>
示例10: error_reporting
error_reporting(E_ALL);
/*include database connection*/
require_once 'scripts/prepend.php';
// If user is not logged in redirect to index.php
if (!$user->userExists()) {
header('Location: index.php');
die;
}
if (!$user->active) {
header('Location: notActive.php');
die;
}
require_once 'scripts/functions/functions.php';
/* Start HTML*/
startHTML("Dashboard", false);
?>
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/" style="height:auto;">
<h2>Managers Companion</h2>
</a>