本文整理汇总了PHP中writeHeader函数的典型用法代码示例。如果您正苦于以下问题:PHP writeHeader函数的具体用法?PHP writeHeader怎么用?PHP writeHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了writeHeader函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wikiToHtml
function wikiToHtml(&$session, $wiki_text)
{
$lines = explode("\n", $wiki_text);
$session->trace(TC_Util1, 'wikiToHtml: ' . (0 + count($lines)) . ' Zeilen' . "({$lines['0']})");
$status = new LayoutStatus($session);
$last_linetype = '';
foreach ($lines as $ii => $line) {
$start_code = false;
if (!$status->fPreformatted && ($line_trimmed = trim($line)) == '') {
$last_linetype = '';
$status->changeOfLineType($last_linetype, '');
} else {
$linetype = $status->fPreformatted ? '[' : substr($line, 0, 1);
switch ($linetype) {
case '-':
$count = countRepeats($line, '-');
if ($count < 4) {
$linetype = 'x';
}
break;
case '[':
if (strpos($line, 'code]') == 1) {
$start_code = true;
} elseif (strpos($line, '/code]') == 1) {
$status->finishCode();
$last_linetype = 'x';
$line = $line_trimmed = substr($line, 7);
$session->trace(TC_Util2, 'wikiToHtml: /code-Restzeile: ' . $line);
} else {
$linetype = 'x';
}
break;
case '!':
case ';':
case '*':
case '#':
case '|':
break;
default:
$linetype = 'x';
break;
}
$last_linetype = $status->testChangeOfLineType($last_linetype, $linetype);
switch ($linetype) {
case '!':
if (strpos($line, '|') != 1) {
writeHeader($line, $status);
} else {
writeTableHeader($line, $status);
$last_linetype = '|';
}
break;
case '[':
if ($start_code) {
$status->startCode();
}
$line = substr($line_trimmed, 6);
if (!empty($line)) {
writeLine($line, $status);
}
break;
case ';':
writeIndent($line, $status);
break;
case '*':
writeUList($line, $status);
break;
case '#':
writeOrderedList($line, $status);
break;
case '|':
writeTable($line, $status);
break;
case '-':
guiLine($status->fSession, $count - 3);
break;
default:
writeLine($line, $status);
break;
}
}
}
// foreach
if ($status->fPreformatted) {
$session->trace(TC_Warning, PREFIX_Warning . '[/code] fehlt');
}
$session->trace(TC_Util1, 'wikiToHtml-Ende');
}
示例2: login
exit;
}
if (isset($_REQUEST["sortBy"])) {
$sortBy = $_REQUEST["sortBy"];
} else {
$sortBy = "";
}
if (isset($_REQUEST["sortDir"])) {
$sortDir = $_REQUEST["sortDir"];
} else {
$sortDir = "ASC";
}
$db = login();
$selfUrl = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"];
$msg = "";
writeHeader("Building session- build new session", "secure", $msg);
wizardHeader(2);
//echo "<p><font size=+1><a href=\"selectExistingSession.php?table=sessions&returnURL=".urlencode($selfUrl)."&returnIdName=sessionId\">Select existing session</a>\n";
//echo " or add a new session:\n</font></p>";
$idStr = '<a href="buildSession3.php?studyId=' . $studyId . '&sessionId=<ID>"><ID></a>';
$sortbyStr = '<a href="' . selfURL() . '?table=' . $table . '&studyId=' . $studyId . '&sortDir=<DIR2>&sortBy=<ID>"><ID><DIR></a>';
if ($sortBy == "") {
// Default sort
$sortBy = 'id';
}
$displaySummary = 1;
echo "<p><font size=+1><b>Select from the following existing sessions:</b></font></p>";
//tableText = displayTable($db, $table, $idStr, "WHERE primaryStudyID=".$studyId, 0, $displaySummary, "", $studyId, $subjectId, $sessionId, "", "", "", "");
$tableText = displayTable($db, $table, $idStr, "WHERE primaryStudyID=" . $studyId, 0, $displaySummary, "", $studyId, 0, $sessionId, $sortbyStr, $sortBy, $sortDir, "");
if ($tableText != "") {
echo $tableText;
示例3: login
login();
if (!isset($_REQUEST["scanner"])) {
$scanner = $scannerList[0];
} else {
$scanner = $_REQUEST["scanner"];
}
$src = $GLOBALS["conf"]->rawDataSrc[$scanner];
$cacheDir = $GLOBALS["conf"]->protocolCacheDir . "_" . $scanner;
$cacheTime = date("l M j, Y \\a\t g:ia T", filemtime($cacheDir));
if (isset($_REQUEST["scanner"]) && isset($_REQUEST["refreshCache"])) {
getAllProtocols($src, $cacheDir);
// We do a redirect so that the 'refreshCache' flag won't remain in the url.
header("Location: " . $_SERVER["PHP_SELF"] . "?scanner=" . urlencode($_REQUEST["scanner"]));
exit;
}
writeHeader("Protocol Wizard", "secure");
foreach ($GLOBALS["conf"]->rawDataSrc as $key => $val) {
if (isset($val->protocolDir)) {
$scannerList[] = $key;
}
}
if (isset($_REQUEST["add"]) && isset($_REQUEST["scanner"]) && isset($_REQUEST["cat"]) && isset($_REQUEST["protocol"])) {
$protocol = getCachedProtocol($cacheDir, $_REQUEST["cat"], $_REQUEST["protocol"]);
echo "<h1>Select a series from " . $protocol['name'] . ":</h1>\n";
echo "<ul>\n";
foreach ($protocol['series'] as $sNum => $s) {
echo "<li>Series {$sNum} (" . $s['sedesc'] . "):";
echo "<form method=POST name=\"protocolWizard_form\" action=\"editTable.php\">\n";
echo "<input type=hidden name=table value=protocols>\n";
echo "<input type=hidden name=d[protocols][protocolName] value=\"" . $protocol['name'] . "\">\n";
foreach ($s as $name => $value) {
示例4: list
} else {
list($success, $m) = deleteRecord($db, $table, $deleteId);
if (strlen($msg > 0)) {
$msg .= " / " . $m;
} else {
$msg = $m;
}
// We do a redirect so that the 'deleteId' won't remain in the url.
// *** RFD: There's got to be a better way!
header("Location: " . $_SERVER["PHP_SELF"] . "?table=" . $table . "&msg=" . urlencode($msg));
exit;
}
}
if (isset($_REQUEST["updateId"])) {
$d[$table]['id'] = $_REQUEST["updateId"];
} else {
$d[$table]['id'] = 0;
}
// Here we actually start writing the HTML.
writeHeader("Edit {$table}", "secure", $msg);
wizardHeader(1);
if ($d[$table]['id'] != 0) {
echo "<h1>Update entry in table '{$table}':</h1>\n";
} else {
echo "<p><font size=+1><b>Add entry to table '{$table}':</b></font></p>\n";
}
$selfUrl = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"];
// The following function requires the non-trivial code above to process the
// data, so I'm not sure that it makes sense to keep it in a separate function.
echo buildFormFromTable($db, $table, $prevTable, $selfUrl, $d, $extras, $defaultDataId);
writeFooter('basic');
示例5: login
<?php
require_once "include.php";
//init_session();
$db = login();
writeHeader("Home", "basic");
?>
<h1>mrData advanced index</h1>
<ul>
<li><a href="editTable.php?table=studies">Edit studies</a></li>
<li><a href="editTable.php?table=rois">Edit ROIs</a></li>
<li><a href="editTable.php?table=subjects">Edit subjects</a></li>
<li><a href="editTable.php?table=users">Edit users</a></li>
<li><a href="editTable.php?table=sessions">Edit sessions</a></li>
<li><a href="editTable.php?table=scans">Edit scans</a></li>
<li><a href="editTable.php?table=stimuli">Edit stimuli</a></li>
<li><a href="editTable.php?table=protocols">Edit protocols</a></li>
<li><a href="editTable.php?table=dataFiles">Edit datafiles</a></li>
<li><a href="editTable.php?table=analyses">Edit analyses</a></li>
<hr>
<li><a href="displayTable.php?table=studies">Show studies</a></li>
<li><a href="displayTable.php?table=rois">Show ROIs</a></li>
<li><a href="displayTable.php?table=subjects">Show subjects</a></li>
<li><a href="displayTable.php?table=users">Show users</a></li>
<li><a href="displayTable.php?table=scans">Show scans</a></li>
<li><a href="displayTable.php?table=protocols">Show scan protocols</a></li>
<li><a href="displayTable.php?table=sessions">Show sessions</a></li>
<li><a href="displayTable.php?table=dataFiles">Show data files</a></li>
<li><a href="displayTable.php?table=analyses">Show analyses</a></li>
<hr>
<li><a href="showPfiles.php?scanner=lucas15t">View Lucas 1.5T P-files</a></li>
示例6: db_free_result
db_free_result($result);
}
if (!empty($tables)) {
$folder = SERVERPATH . "/" . BACKUPFOLDER;
$filename = $folder . '/backup-' . date('Y_m_d-H_i_s') . '.zdb';
if (!is_dir($folder)) {
mkdir($folder, FOLDER_MOD);
}
@chmod($folder, FOLDER_MOD);
$writeresult = $handle = @fopen($filename, 'w');
if ($handle === false) {
$msg = sprintf(gettext('Failed to open %s for writing.'), $filename);
echo $msg;
} else {
$writeresult = writeheader('file_version', 1);
$writeresult = $writeresult && writeHeader('compression_handler', $compression_handler);
if ($writeresult === false) {
$msg = gettext('failed writing to backup!');
}
$counter = 0;
$writeresult = true;
foreach ($tables as $row) {
$table = array_shift($row);
$unprefixed_table = substr($table, strlen($prefix));
$sql = 'SELECT * from `' . $table . '`';
$result = query($sql);
if ($result) {
while ($tablerow = db_fetch_assoc($result)) {
extendExecution();
$storestring = serialize($tablerow);
$storestring = compressRow($storestring, $compression_level);
示例7: login
*/
require_once "include.php";
$db = login();
$msg = "Connected as user " . $_SESSION['username'];
if (isset($_REQUEST["tbl"])) {
$tbl = $_REQUEST["tbl"];
} else {
$tbl = "studies";
}
if (isset($_REQUEST["fld"])) {
$fld = $_REQUEST["fld"];
} else {
$fld = "all fields";
}
$selfURL = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"];
writeHeader("Search tool", "secure", $msg);
echo "<h1>Search tool:</h1>\n";
/*
// Get searchable (i.e. text) fields in mrData db
$mrDataTables = array('people', 'scans', 'sessions', 'studies');
//$textTypes = array('');
$notgoodarray = array('species', 'scannerCertified', )
foreach ($mrDataTables as $value){
$query = "SELECT * FROM $value";
if(!$res = mysql_query($query, $db)){
print "\n<p>ERROR ".mysql_error($db);
exit;
}
$fullTextString = '';
for($i = 0; $i < mysql_num_fields($res); $i++){
// echo mysql_field_type($res, $i);
示例8: login
<?php
require_once "include.php";
//init_session();
login();
writeHeader("Get Data Files", "secure");
$secureUrlBase = "https://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
if (!isset($_REQUEST["scanner"])) {
$scanner = "lucas15t";
} else {
$scanner = $_REQUEST["scanner"];
}
$ifileServer = $GLOBALS["conf"]->rawDataSrc["lucas"]->user . "@" . $GLOBALS["conf"]->rawDataSrc["lucas"]->host;
$src = $GLOBALS["conf"]->rawDataSrc[$scanner];
if (!isset($_REQUEST["examNum"])) {
$examNum = $_REQUEST["examNum"];
}
if (isset($examNum) && $examNum != "") {
// Note that for this to work, you must have an ssh private
// key stored in the specified place (/var/www/.ssh/id_dsa).
// The public component of this key needs to be entered into
// the /home/wandell/.shh/authorized_hosts file on lucas.
// ("ssh-keygen -t rsa -f /var/www/.ssh/id_dsa" will make the keys.)
$series = `ssh -i /var/www/.ssh/id_dsa -o "StrictHostKeyChecking no" {$ifileServer} listseries -r {$src->name} {$examNum}`;
echo "<p>Scan series from exam <strong>{$examNum}</strong> on <strong>{$src->name}</strong>:</p>\n";
echo "<pre>{$series}</pre>\n";
}
$pfileTree = listPfiles($src);
if (!$pfileTree) {
echo "<p class=msg>No P-files found.</p>\n";
} else {
示例9: writeHeader
echo "<h1>Display record:</h1>\n";
} else {
if ($sessionId > 0) {
writeHeader("Browse scan", "secure", $msg);
checkSessionForRecon($db, $studyId, $sessionId);
echo "<h1> Browse scan:</h1>\n";
} else {
if ($subjectId > 0) {
writeHeader("Browse session", "secure", $msg);
echo "<h1>Browse session:</h1>\n";
} else {
if ($studyId > 0) {
writeHeader("Browse subject", "secure", $msg);
echo "<h1>Browse subject:</h1>\n";
} else {
writeHeader("Browse study", "secure", $msg);
echo "<h1>Browse study:</h1>\n";
}
}
}
}
echo '<p><a href="' . selfURL() . '?studyId=' . $studyId . '&subjectId=' . $subjectId . '&sessionId=' . $sessionId . '&scanId=' . $scanId . '&displaySummary=1' . '">Summary (default)</a>' . "\n";
echo ' <a href="' . selfURL() . '?studyId=' . $studyId . '&subjectId=' . $subjectId . '&sessionId=' . $sessionId . '&scanId=' . $scanId . '&displaySummary=0' . '">Full</a>' . "</p>\n";
/*echo "studyId=".$studyId." subjectId=".$subjectId." sessionId=".$sessionId." scanId=".$scanId;*/
if ($scanId > 0) {
$table = 'scans';
$tableText = displayRecord($db, $table, "WHERE id=" . $scanId, $studyId, $subjectId, $sessionId, $scanId);
if ($tableText != "") {
echo $tableText;
} else {
echo "<p class=error>Entry not found.</p>\n";
示例10: store
/**
* stores the string information
*
* @param string $file the string containing the filename the string's in
* @param string $input the string containing the msgid/msgstr block
* @param array $filelist the array containing the version info of the files
* @param boolean $get the boolean switch whether the call is storing
* something or trying to get the whole storage back
*
* @return array the array with the whole storage; only when $get == true
*/
function store($file = 0, $input = 0, $filelist = array(), $get = false)
{
static $storage = array();
if (!$get) {
if (isset($storage[$file])) {
$storage[$file][1] = array_unique(array_merge($storage[$file][1], $filelist));
$storage[$file][] = $input;
} else {
$storage[$file] = array();
$storage[$file][0] = writeHeader($file);
$storage[$file][1] = $filelist;
$storage[$file][2] = $input;
}
} else {
return $storage;
}
}
示例11: writeHeader
}
if (isset($_REQUEST["sessionId"])) {
$sessionId = $_REQUEST["sessionId"];
} else {
echo "<p class=error>Error: Can't get the session id.</p>\n";
exit;
}
if (isset($_REQUEST["scanId"])) {
$scanId = $_REQUEST["scanId"];
} else {
echo "<p class=error>Error: Can't get the scan id.</p>\n";
exit;
}
$selfUrl = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["PHP_SELF"];
$msg = "";
writeHeader("Building session- Process finished", "secure", $msg);
$q = "SELECT subjectID FROM sessions WHERE id=" . $sessionId;
if (!($res = mysql_query($q, $db))) {
print "\n<p>mrData ERROR: " . mysql_error($db);
exit;
}
$getrow = mysql_fetch_row($res);
$subjectId = $getrow[0];
echo "<p><font size=+2>Congratulations! You have successfully added the following record(s):</font></p>\n";
echo "<p><b>Study:</b></p>";
$table = 'studies';
$displaySummary = 1;
$tableText = displayTable($db, $table, "", "WHERE id=" . $studyId, 0, $displaySummary, "", $studyId, $subjectId, $sessionId, "", "", "", "");
if ($tableText != "") {
echo $tableText;
} else {
示例12: login
<?php
require_once "include.php";
//init_session();
$db = login();
writeHeader("Get Data Files", "basic");
$secureUrlBase = "https://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/";
echo "<p class=warn>This is just a place-holder function. When it's finished, you'll be able ";
echo "to select the data files that you want to add and specify if you want them transferred.</p>\n";
if (!isset($_REQUEST["scanner"])) {
$scanner = "lucas 1.5t";
} else {
$scanner = $_REQUEST["scanner"];
}
$ifileServer = "wandell@lucas.stanford.edu";
$dataSrc = getDataSourceInfo($scanner);
if (isset($_REQUEST["examNumber"])) {
$examNumber = $_REQUEST["examNumber"];
} else {
$examNumber = 0;
}
if ($examNumber != 0) {
// Note that for this to work, you must have an ssh private
// key stored in the specified place (/var/www/.ssh/id_dsa).
// The public component of this key needs to be entered into
// the /home/wandell/.shh/authorized_hosts file on lucas.
// ("ssh-keygen -t rsa -f /var/www/.ssh/id_dsa" will make the keys.)
$series = `ssh -i /var/www/.ssh/id_dsa -o "StrictHostKeyChecking no" {$ifileServer} listseries -r {$dataSramc->name} {$examNum}`;
echo "<p>Scan series from exam <strong>{$examNum}</strong> on <strong>{$scanner}</strong> ({$dataSrc->name}):</p>\n";
echo "<pre>{$series}</pre>\n";
}
示例13: writeHeader
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="author" content="William Jessup University" />
<meta name="viewport" content="width=1024" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title><?php
echo $sPageTitle;
?>
</title>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic" />
<link rel="stylesheet" href="/css/normalize.css" />
<link rel="stylesheet" href="/css/global.css" />
<?php
writeHeader();
?>
</head>
<body>
<?php
if (isLoggedIn() && $bRegLogin) {
?>
<a href="/?logout=true" class="logout">Logout <?php
echo $_SESSION['user'];
?>
</a><?php
}
?>
示例14: getResponse
public static function getResponse($request)
{
require_once 'web/header.inc';
require_once 'web/page.inc';
require_once 'web/footer.inc';
require_once 'template/TemplateManager.php';
//inizio il conteggio delle query
require_once 'session.php';
Session::initializeQueryCounter();
self::$user = Session::getUser();
$data = self::elaborateRequest($request);
if (self::$requestedObject == "Login") {
self::redirect("");
} else {
if (self::$requestedObject == "Logout") {
Session::destroy();
self::redirect("");
}
}
$default = TemplateManager::getDefaultTemplate();
$parser = null;
$tentativi = 0;
while (is_numeric($parser) || is_null($parser)) {
$template = TemplateManager::getTemplateForRequest(self::$requestedObject, self::$currentID, self::$requestedAction);
if (is_numeric($parser) || is_null($template) || $template === false) {
$template = $default;
}
if ($tentativi == 1) {
echo "<h3>ERRORE IN " . $template . "</h3>";
}
if ($tentativi == 2) {
echo "<h3>ERRORE NEL TEMPLATE DI DEFAULT</h3>";
return;
}
$tentativi++;
$parser = TemplateParser::parseTemplate($template);
//echo "<p>" . serialize(is_numeric($parser)) . "</p>"; //DEBUG
}
//echo "parser creato: " . serialize($parser) . "<br />"; //DEBUG
$css = array();
$js = array();
$title = self::titleForRequest($request);
$cols_stack = array();
$write_h = false;
$write_f = false;
$ad = false;
// $i=0; //DEBUG
while ($el = $parser->nextElement()) {
// if($i==10) //DEBUG
// return; //DEBUG
// $i++; //DEBUG
$id = null;
$class = null;
switch ($el["tag"]) {
case "TEMPLATE":
break;
case "HEAD":
if ($el["type"] != "close") {
continue;
}
writeHeader($title, $css, $js);
break;
case "STYLESHEET":
if (isset($el["attributes"]["CSS"])) {
$c = $el["attributes"]["CSS"];
if ($c != "default/default") {
$css[] = $c;
}
}
break;
case "JS":
if (isset($el["attributes"]["SRC"])) {
$js[] = $el["attributes"]["SRC"];
}
break;
case "HEADER":
$write_h = true;
if ($el["type"] == "close") {
writePageHeader(self::$user, $ad);
$write_h = false;
}
break;
case "FOOTER":
$write_f = true;
if ($el["type"] == "close" || $el["type"] == "complete") {
writePageFooter(null, $ad);
$write_f = false;
}
break;
case "AD":
if ($write_h || $write_f) {
$ad = true;
} else {
$style = "default";
if (isset($el["attributes"]["STYLE"])) {
$style = $el["attributes"]["STYLE"];
}
writeAD($style);
}
break;
//.........这里部分代码省略.........
示例15: fwrite
fwrite($fh, '$MESSAGE = array();' . "\n");
fwrite($fh, '$OVERVIEW = array();' . "\n");
fclose($fh);
}
// create some more default files
if ($type == 'module') {
$files = array('index', 'install', 'uninstall', 'upgrade');
if ($func == 'tool') {
array_push($files, 'tool');
} else {
array_push($files, 'add', 'view', 'modify');
}
foreach ($files as $n) {
$fh = fopen($full . '/' . $n . '.php', 'w');
if ($fh) {
writeHeader($fh, $name, $author, $type);
fclose($fh);
}
}
}
// if it's a template...
if ($type == 'template') {
$contents = file_get_contents($full . '/index.php');
$contents .= "\n\$dwoodata\t= array(); // if you need to set some additional template vars, add them here\nglobal \$page_id;\n\$variant = CAT_Helper_Page::getPageSettings(\$page_id,'internal','template_variant');\nif ( \$variant == '' ) \$variant = DEFAULT_TEMPLATE_VARIANT;\nif ( \$variant == '' || !file_exists(CAT_PATH.'/templates/bootstrap/templates/'.\$variant.'/index.tpl' ) )\n \$variant = 'default';\n\$parser->setPath(CAT_TEMPLATE_DIR.'/templates/'.\$variant);\n\$parser->setFallbackPath(CAT_TEMPLATE_DIR.'/templates/default');\n\$parser->output('index.tpl',\$dwoodata);\n";
file_put_contents($full . '/index.php', $contents);
CAT_Helper_Directory::createDirectory($full . '/templates/default');
CAT_Helper_Directory::recursiveCreateIndex($full . '/templates');
}
// insert module into DB
foreach ($info as $key => $value) {
$key = str_replace($pre, 'module_', $key);