本文整理汇总了PHP中generateHeader函数的典型用法代码示例。如果您正苦于以下问题:PHP generateHeader函数的具体用法?PHP generateHeader怎么用?PHP generateHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了generateHeader函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addOptions
function addOptions()
{
if (isset($_POST['gi_subtle_reset'])) {
themeGluedIdeas_Subtle::initOptions(true);
}
if (isset($_POST['gi_subtle_save'])) {
$aOptions = themeGluedIdeas_Subtle::initOptions(false);
$aOptions['errors'] = array();
$aOptions['style'] = $_POST['gi_subtle_style'];
$aOptions['description'] = stripslashes($_POST['gi_subtle_description']);
$aOptions['lead_count'] = $_POST['gi_subtle_lead_count'];
$aOptions['lead_cats'] = $_POST['gi_subtle_lead_cats'];
$aOptions['feedburner'] = $_POST['gi_subtle_feedburner'];
$aOptions['feedburner_id'] = $_POST['gi_subtle_feedburner_id'];
if ($_POST['gi_subtle_show_archives'] == 'true') {
$aOptions['show_archives'] = true;
} else {
$aOptions['show_archives'] = false;
}
if ($_POST['gi_subtle_show_metalinks'] == 'true') {
$aOptions['show_metalinks'] = true;
} else {
$aOptions['show_metalinks'] = false;
}
$aOptions['archives_cat'] = $_POST['gi_subtle_archives_cat'];
if ($_POST['gi_subtle_show_subpages'] == 'true') {
$aOptions['show_subpages'] = true;
} else {
$aOptions['show_subpages'] = false;
}
if ($_POST['gi_subtle_show_feedflare'] == 'true') {
$aOptions['show_feedflare'] = true;
} else {
$aOptions['show_feedflare'] = false;
}
if ($_POST['gi_subtle_show_gravatar'] == 'true') {
$aOptions['show_gravatar'] = true;
} else {
$aOptions['show_gravatar'] = false;
}
$aOptions['gravatar_rating'] = $_POST['gi_subtle_gravatar_rating'];
$aOptions['gravatar_default'] = $_POST['gi_subtle_gravatar_default'];
// Handle header creation if a valid JPG was sent
$sStyleFolder = get_theme_root() . '/' . get_template() . '/styles/' . $aOptions['style'] . '/';
if (is_uploaded_file($_FILES['gi_subtle_header']['tmp_name']) || $_POST['gi_subtle_reset_header'] == 'true') {
if (file_exists($sStyleFolder . 'generator.php')) {
include_once $sStyleFolder . 'generator.php';
$aOptions['errors'] = generateHeader($sStyleFolder, $_POST['gi_subtle_reset_header']);
} else {
$aOptions['errors'][] = __('This theme style does not support uploadable headers', 'gluedideas_subtle');
}
}
update_option('gi_subtle_theme', $aOptions);
}
add_theme_page("Glued Ideas 'Subtle' Theme Options", "Current Theme Options", 'edit_themes', basename(__FILE__), array('themeGluedIdeas_Subtle', 'displayOptions'));
}
示例2: realpath
<?php
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
include "{$root}/include_files/heading.php";
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta property="og:title" content="Greatest Games" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.greatestgamez.com/" />
<meta property="og:image" content="http://www.greatestgamez.com" />
<meta property="fb:admins" content="100007419488033" />
<title>Greatest Games</title>
<link rel="stylesheet" type="text/css" href="http://www.greatestgamez.com/css_files/homestylecss.css"/>
<link rel="shortcut icon" href="http://www.greatestgamez.com/images/favicon.ico">
</head>
<body>
<?php
generateHeader("puzzle");
?>
<p><embed src="http://games.mochiads.com/c/g/bloons-tower-defense-3-distribute/bloonstd3.swf" menu="false" quality="high" width="640" height="480" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></p>
<?php
generateFooter();
?>
</body>
</html>
示例3: session_start
<?php
require_once 'libcollection.php';
session_start();
canUserNavigateToPage();
db_connect();
$result = retrive_info('generatedbooks', $_SESSION['username'], '*');
db_close();
?>
<!DOCTYPE html>
<?php
generateHeader("Home", array("css/homeStyle.css"), array("js/circle.js"));
generateNav();
?>
<div id="first">
<p class="intro">Welcome to storybook generator!</p>
<p> Here you have the opportunity to create your
own personal storybooks. You pick a template, characters, and setting and leave
the rest to us.</p>
</div>
<div id="content">
<h4>Previous Works</h4>
<p>Read previous works</p>
<?php
if (count($result) != 0) {
while (count($result) != 0) {
$book = array_pop($result);
echo <<<ZZEOF
<form action="userAction.php" method="POST">
<input type = "hidden" name="id" value="{$book['id']}"/>
<label>{$book["title"]}</label>
示例4: generateHeader
include 'views/groups.php';
break;
case 'account':
$output .= generateHeader("Your Account", $_SESSION["login"]);
include 'views/account.php';
break;
case 'friends':
$output .= generateHeader("Friends", $_SESSION["login"]);
include 'views/friends.php';
break;
case 'chatApp':
$output .= generateHeader("Chat", $_SESSION["login"]);
include 'views/chatApp.php';
break;
case '403':
$output .= generateHeader("Forbidden", $_SESSION["login"]);
include 'views/403.php';
break;
default:
$output .= generateHeader("Page Not Found", $_SESSION["login"]);
include 'views/404.php';
break;
}
mysqli_close($conn);
//Add footer to the page
$output .= file_get_contents("templates/footer.html");
//closing html tags
//Every time 'var_host' appears in the html, it's replaces with $host.
//Allows for more elegant navigation.
$output = str_replace("var_host", $host, $output);
echo $output;
示例5: generateHTML
/**
* Put all the other functions together to produce a full
* HTML page.
*
* @param string $title The document's title
* @param string $content The main content for the page
* @return string Full formatted HTML page
*/
function generateHTML($title = 'Default Title', $content = 'Default Content')
{
$head = generateHeader($title);
$body = generateBody($title, $content);
return '<html>' . $head . $body . '</html>';
}
示例6: header
header('Location: ' . $host);
} else {
//changed from spit to echo. maybe add CSS?
echo '<p>!!Login failed!! Please try again</p>';
}
// ------- END form processing code... -------
}
}
}
//Assuming this is a register submission
if (isset($_POST['register'])) {
//Starting the Hasher, and declaring the password variable
require "libs/PasswordHash.php";
$hasher = new PasswordHash(8, false);
$password = "*";
$output = generateHeader("Sign in", true);
$output .= file_get_contents('templates/login.html');
$output .= file_get_contents('templates/register.html');
$output .= "<h2> Error: </h2>";
//If the password's DONT match, spit it back.
if ($_POST['password1'] !== $_POST['password2']) {
$output .= "<p>Passwords don't match.</p>";
} else {
if (!validEmail($_POST['email'])) {
$output .= "<p>Email not valid.</p>";
} else {
if (strlen($_POST['password1']) >= 6 && strlen($_POST['name']) >= 4 && validEmail($_POST['email'])) {
$email = $_POST['email'];
$username = $_POST['name'];
$password = $_POST['password1'];
// To protect MySQL injection for Security purpose
示例7: generateHeader
const CONSUMER_KEY = '';
const CONSUMER_SECRET = '';
const TOKEN = '';
const TOKEN_SECRET = '';
function generateHeader($method, $url, $params = null)
{
$consumer = new JacobKiers\OAuth\Consumer\Consumer(CONSUMER_KEY, CONSUMER_SECRET);
$token = new JacobKiers\OAuth\Token\Token(TOKEN, TOKEN_SECRET);
$oauthRequest = JacobKiers\OAuth\Request\Request::fromConsumerAndToken($consumer, $token, $method, $url, $params);
$oauthRequest->signRequest(new JacobKiers\OAuth\SignatureMethod\HmacSha1(), $consumer, $token);
return trim(substr($oauthRequest->toHeader(), 15));
}
$postData = 'follow=' . TWITTER_USER_ID;
$method = 'POST';
$url = 'https://stream.twitter.com/1.1/statuses/filter.json';
$headers = ['Authorization' => generateHeader($method, $url, ['follow' => TWITTER_USER_ID]), 'Content-Type' => 'application/x-www-form-urlencoded', 'Content-Length' => strlen($postData)];
$source = \Rx\React\Http::post($url, $postData, $headers, '1.1')->streamResults()->share();
$connected = $source->take(1)->doOnNext(function () {
echo 'Connected to twitter, listening in on stream:', PHP_EOL;
});
$allTweets = $connected->merge($source)->lift(function () {
return new \Rx\Extra\Operator\CutOperator(PHP_EOL);
})->filter(function ($tweet) {
return strlen(trim($tweet)) > 0;
})->map(function ($tweet) {
return json_decode($tweet);
});
$endTwitterStream = $allTweets->filter(function ($tweet) {
return is_object($tweet);
})->filter(function ($tweet) {
return trim($tweet->text) == 'exit();';
示例8: runReport
function runReport($reportName)
{
global $xoopsOption, $xoopsTpl, $xoopsConfig, $xoopsUser, $xhelp_module_header, $paramVals;
$classname = 'xhelp' . $reportName . 'Report';
include_once XHELP_REPORT_PATH . '/' . $reportName . '.php';
$report = new $classname();
// Get any parameters for report
$reportParams = $report->getParams();
// Fill reportParameters with updated information
if (count($reportParams) > 0) {
foreach ($reportParams as $param) {
if (isset($_REQUEST[$param->fieldname])) {
if ($param->controltype == XHELP_CONTROL_DATETIME) {
$param->value = strtotime($_REQUEST[$param->fieldname]);
} else {
$param->value = $_REQUEST[$param->fieldname];
}
} else {
if (isset($paramVals[$param->fieldname])) {
if ($param->controltype == XHELP_CONTROL_DATETIME) {
$param->value = strtotime($paramVals[$param->fieldname]);
} else {
if (is_array($paramVals[$param->fieldname])) {
$param->values = $paramVals[$param->fieldname];
} else {
$param->value = $paramVals[$param->fieldname];
}
}
}
}
}
$report->extraWhere = $report->makeWhere($reportParams);
}
//$xoopsOption['template_main'] = 'xhelp_report.html'; // Set template
require XOOPS_ROOT_PATH . '/header.php';
// Include page header
generateHeader($report);
$oRenderer =& xhelpReportRendererFactory::getRenderer('html', $report);
echo $oRenderer->render();
$xoopsTpl->assign('xhelp_imagePath', XHELP_IMAGE_URL . '/');
$xoopsTpl->assign('xoops_module_header', $xhelp_module_header);
require XOOPS_ROOT_PATH . '/footer.php';
}
示例9: startSession
<?php
require_once 'libcollection.php';
startSession();
$message = '';
$user = '';
$password = '';
generateHeader("Login", array("css/loginStyle.css"), array("http://code.jquery.com/ui/1.9.2/jquery-ui.js", "https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js", "jquery/jqueryClock.js"));
?>
<div id="loginClock"></div>
<div class="password">
<form action="tryLogin.php" method="POST">
<fieldset>
<h1>Login</h1>
<?php
if (isset($_SESSION['username']) && isset($_SESSION['password'])) {
echo '<p>Incorrect username/password combination</p>';
}
?>
<p>Please enter your username:</p>
<input type="text" name="username" value="<?php
if (isset($_SESSION['username'])) {
echo $_SESSION['username'];
unset($_SESSION['username']);
}
?>
"/>
<p class="ques">Please enter your password:</p>
<input type="password" name="password" value="<?php
if (isset($_SESSION['password'])) {
echo $_SESSION['password'];
示例10: generateClassObjectCreator
$output .= generateClassObjectCreator($tableName, $className, $fields);
// Done
$output .= generateClassFetchData($tableName, $className, $fields);
// Done
$output .= generateClassGetID($className, $fields);
// DONE
foreach ($fields as $fieldName => $field) {
$output .= generateClassGetField($className, $fieldName, $field);
// Done
}
$output .= generateClassDelete($tableName, $fields);
$output .= generateClassUpdate($tableName, $className, $fields);
// Done
$output .= generateClassBottom($className);
// Done
return $output;
}
global $conn;
if ($argc < 2) {
print "Usage: " . $argv[0] . " <table_name>\n";
exit - 1;
}
$tableName = $argv[1];
$meta = pg_meta_data($conn, $tableName);
if (!is_array($meta)) {
print "Error: table {$tableName} not found\n";
exit - 1;
}
print generateHeader($tableName);
print generate_GETOBJECT($tableName);
print generateClass($tableName, $meta);
示例11: realpath
<?php
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
include "{$root}/include_files/heading.php";
?>
<!DOCTYPE html>
<html>
<head>
<?php
heading();
?>
<title>Greatest Games Search</title>
<link rel="stylesheet" type="text/css" href="http://www.greatestgamez.com/css_files/homestylecss.css"/>
</head>
<body>
<?php
generateHeader("home");
?>
<p></p>
<?php
$searchwords = $_REQUEST["searchwords"];
print "<h1 style=\"color:white\">No search results found for \"{$searchwords}\".</h1>";
?>
<?php
generateFooter();
?>
</body>
</html>
示例12: realpath
<?php
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
include "{$root}/include_files/heading.php";
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta property="og:title" content="Greatest Games" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.greatestgamez.com/" />
<meta property="og:image" content="http://www.greatestgamez.com" />
<meta property="fb:admins" content="100007419488033" />
<title>Greatest Games</title>
<link rel="stylesheet" type="text/css" href="http://www.greatestgamez.com/css_files/homestylecss.css"/>
<link rel="shortcut icon" href="http://www.greatestgamez.com/images/favicon.ico">
</head>
<body>
<?php
generateHeader("action");
?>
<p></p>
<p>
<a href="http://www.greatestgamez.com/action_games/template.php"><h1>GALAXY SHOOT</h1></a>
</p>
<?php
generateFooter();
?>
</body>
</html>
示例13: generateHeader
<?php
require_once 'libcollection.php';
generateHeader("Account Settings", array("css/loginStyle.css", "css/navbar.css"));
generateNav();
?>
<div class="password" >
<form method="POST" action="updateAccount.php">
<fieldset id = "field">
<h1>Account Settings</h1>
<?php
if (isset($_SESSION['message'])) {
echo '<p>' . $_SESSION['message'] . '</p>';
unset($_SESSION['message']);
}
?>
<p class="ques">Please enter a new password:</p>
<input id ="password" type="password" name="password" value="<?php
if (isset($_SESSION['password'])) {
echo $_SESSION['password'];
unset($_SESSION['password']);
}
?>
"/><br/>
<input type="submit" value="Update Password" name="pass" id="pass"/><br />
<p class="ques">Delete your account:</p>
<input type="submit" value="Delete Account" name="delete" id="delete"/><br />
</fieldset>
</form>
</div>
<?php
示例14: generateTimeHeader
function generateTimeHeader($name, $unixTime, $responseCode)
{
generateHeader($name, gmdate("D, d M Y H:i:s", $unixTime) . " GMT", $responseCode);
}
示例15: generateHeader
<!-- NOTE: this code was modified from the given code in the previous projects folder-->
<?php
require_once 'libcollection.php';
generateHeader('Admin Page');
?>
<?php
if ($DB_FIRST_ADMIN_ONLY == FALSE) {
?>
<p>You must have administration permission</p>
<?php
/*Display a message indicating status of the below operations*/
} else {
if (isset($_SESSION['message'])) {
echo '<p id="message">' . $_SESSION['message'] . '</p>';
unset($_SESSION['message']);
}
?>
<a href="dbinit.php">Initialize Database</a><br/>
<a href="populatetables.php">Populate Database tables With Example Data</a><br />
<?php
db_connect();
$users = number_of('users');
$books = number_of('generatedbooks');
db_close();
echo '<p>Number of site users:' . $users . '</p>';
echo '<p>Number of books created:' . $books . '</p>';
?>
<p>Turn off administrator permission when complete.</p>
<?php
}