本文整理汇总了PHP中html_header_demo函数的典型用法代码示例。如果您正苦于以下问题:PHP html_header_demo函数的具体用法?PHP html_header_demo怎么用?PHP html_header_demo使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了html_header_demo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exit
<?php
// $CVSHeader: _freebeer/www/demo/HTML.LockFormFields.php,v 1.3 2004/03/08 04:29:18 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
// \todo fix wget's continuously reporting "End of file while parsing headers."
if (preg_match('/wget/i', $_SERVER['HTTP_USER_AGENT'])) {
echo "<html><body></body></html>";
exit(0);
}
require_once './_demo.php';
require_once FREEBEER_BASE . '/lib/HTML/LockFormFields.php';
echo html_header_demo('fbHTML_LockFormFields Class (Lock Selected Form Fields)');
$msg = 'Values in v1 and v2 are locked. Values in v3 and v4 can be modified.';
$locked_fields = array('textfield1', 'textfield2');
if (isset($_REQUEST['set'])) {
$_REQUEST = fbHTML_LockFormFields::set($_REQUEST, $locked_fields);
} elseif (isset($_REQUEST['check'])) {
if (fbHTML_LockFormFields::check($_REQUEST, $locked_fields)) {
$msg = 'Values in v1 and v2 have not been modified.<br>';
} else {
$msg = '<b>WARNING: v1 and/or v2 have been modified.</b><br>';
}
// $msg .= 'hash=' . fbHTML_LockFormFields::_generateHash($_REQUEST, $locked_fields);
// $msg .= "<br />\n";
} else {
$_REQUEST['textfield1'] = 'Value1';
$_REQUEST['textfield2'] = 'Value2';
$_REQUEST['textfield3'] = 'Value3';
$_REQUEST['textfield4'] = 'Value4';
}
示例2: html_header_demo
<?php
// $CVSHeader: _freebeer/www/demo/Backport.php,v 1.2 2004/03/07 17:51:33 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
require_once './_demo.php';
require_once FREEBEER_BASE . '/lib/Backport.php';
echo html_header_demo('fbBackport.php Demo');
echo "<pre>\n";
$a = array('green', 'red', 'yellow');
$b = array('avocado', 'apple', 'banana');
$rv = array_combine($a, $b);
print_r($rv);
// $rv = array('green' => 'avocado', 'red' => 'apple', 'yellow' => 'banana');
$expected = array('green' => 'avocado', 'red' => 'apple', 'yellow' => 'banana');
assert($expected == $rv);
$a1 = array('a' => 'green', 'b' => 'brown', 'c' => 'blue', 'red');
$a2 = array('a' => 'green', 'yellow', 'red');
$result = array_diff_assoc($a1, $a2);
echo 'array_diff_assoc($a1, $a2)=';
print_r($result);
$expected = array('b' => 'brown', 'c' => 'blue', '0' => 'red');
echo $result == $expected ? 'ok' : '*FAILED*';
echo "\n\n";
$result = sha1('A');
echo 'sha1(A)=', $result, "\n";
$expected = '6dcd4ce23d88e2ee9568ba546c007c63d9131c1b';
echo $result == $expected ? 'ok' : '*FAILED*';
echo "\n\n";
printf("sha1_file(%s)=", basename(__FILE__));
echo sha1_file(__FILE__);
示例3: html_header_demo
<?php
// $CVSHeader: _freebeer/www/demo/setlocale.php,v 1.2 2004/03/07 17:51:34 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
require_once './_demo.php';
require_once FREEBEER_BASE . '/lib/Locale.php';
require_once FREEBEER_BASE . '/lib/ISO639.php';
require_once FREEBEER_BASE . '/lib/ISO639/Alpha3.php';
require_once FREEBEER_BASE . '/lib/ISO639/Map.php';
require_once FREEBEER_BASE . '/lib/ISO3166.php';
require_once FREEBEER_BASE . '/lib/ISO639/ISO3166_Map.php';
require_once FREEBEER_BASE . '/lib/ISO3166/ISO639_Map.php';
echo html_header_demo('fbLocale Class');
// en_US.iso885915
/*
$h = fbISO3166::getIDToNameHash();
$cc2lang = fbISO639_ISO3166_Map::getCountryIDToLanguageIDHash();
$cc2lang = array_flip($cc2lang);
echo "<pre>\n";
foreach ($h as $country_id => $country_name) {
$lang = @$cc2lang[$country_id];
printf("\t\t'%s'\t=> '%s',\t// '%s'\t=> '%s'\n",
$country_id,
$lang,
$country_name,
fbISO639::getLanguageName($lang)
示例4: Class
<?php
// $CVSHeader: _freebeer/www/demo/hmac_login/server_adodb.php,v 1.3 2004/03/07 17:51:34 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
require_once '../_demo.php';
$title = 'fbHMAC_Login_ADOdb Class (Secure Challenge/Response Login)';
require_once FREEBEER_BASE . '/lib/HMAC_Login/ADOdb.php';
$html_header = html_header_demo($title, null, null, false);
require_once FREEBEER_BASE . '/lib/HTTP.php';
$client_url = dirname(dirname($_SERVER['PHP_SELF'])) . '/Hmac_Login.ADOdb.php';
if (!isset($_REQUEST['challenge'])) {
fbHTTP::redirect($client_url);
exit;
}
echo $html_header;
$hmac_login =& new fbHMAC_Login_ADOdb();
$hmac_login->setTimeout(10);
if (!$hmac_login->connect('localhost', 'root', '', 'hmac_login', 'mysql')) {
echo $hmac_login->getLastError();
exit;
}
// $hmac_login->_dbh->debug = true;
$hmac_login->validate(@$_REQUEST['challenge'], @$_REQUEST['response'], @$_REQUEST['login'], @$_REQUEST['password']);
echo $hmac_login->getLastError();
?>
<p>
<a href="<?php
echo $client_url;
?>
示例5: html_header_demo
<?php
// $CVSHeader: _freebeer/www/demo/Binary_Search.File.php,v 1.2 2004/03/07 17:51:33 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
require_once './_demo.php';
require_once FREEBEER_BASE . '/lib/BinarySearch/File.php';
echo html_header_demo('fbBinarySearch_File Class (Binary Search a Sorted, Fixed Length Record File)');
@ini_set('max_execution_time', 0);
echo "<pre>\n";
$file = FREEBEER_BASE . '/etc/geo/geo-ips.txt';
$ips = array('0.0.0.0' => '000.000.000.000 000.255.255.255 US', '10.0.0.1' => '010.000.000.000 010.255.255.255 I0', '10.255.255.255' => '010.000.000.000 010.255.255.255 I0', '127.0.0.1' => '127.000.000.000 127.255.255.255 L0', '127.0.0.2' => '127.000.000.000 127.255.255.255 L0', '127.255.255.255' => '127.000.000.000 127.255.255.255 L0', '172.16.0.0' => '172.016.000.000 172.031.255.255 I0', '172.31.255.255' => '172.016.000.000 172.031.255.255 I0', '192.168.0.0' => '192.168.000.000 192.168.255.255 I0', '192.168.0.1' => '192.168.000.000 192.168.255.255 I0', '192.168.255.255' => '192.168.000.000 192.168.255.255 I0', '217.194.16.0' => '217.194.016.000 217.194.031.255 EU', '217.194.16.1' => '217.194.016.000 217.194.031.255 EU', '255.0.0.0' => '221.097.211.000 255.255.255.255 US', '255.255.255.254' => '221.097.211.000 255.255.255.255 US', '255.255.255.255' => '255.255.255.255 255.255.255.255 --', '9.20.0.0' => '009.020.000.000 009.020.127.255 GB');
function _formatIP4address($ip, $format = '%03d.%03d.%03d.%03d')
{
$l = ip2long($ip);
if ($l == -1 && $ip != '255.255.255.255') {
return false;
}
$tuple1 = $l >> 24;
if ($tuple1 < 0) {
$tuple1 += 256;
}
$rv = sprintf($format, $tuple1, $l >> 16 & 0xff, $l >> 8 & 0xff, $l & 0xff);
//printf("l=%s ip=%s rv=%s\n", $l, $ip, $rv);
return $rv;
}
foreach ($ips as $ip => $expected_result) {
$ipf = _formatIP4address($ip);
$bsf =& new fbBinarySearch_File($file);
$found = $bsf->search($ipf);
$found = trim($found);
示例6: Class
<?php
// $CVSHeader: _freebeer/www/demo/Hmac_Login.MySQL.php,v 1.3 2004/03/08 04:29:18 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
require_once './_demo.php';
$title = 'fbHMAC_Login_MySQL Class (Secure Challenge/Response Login)';
require_once FREEBEER_BASE . '/lib/ErrorHandler.php';
require_once FREEBEER_BASE . '/lib/HMAC_Login/MySQL.php';
fbErrorHandler::init();
echo html_header_demo($title, null, array('../opt/pajhome.org.uk/md5.js', '../lib/StrUtils.js'));
$hmac_login =& new fbHMAC_Login_MySQL();
/// \todo add as fields on from with a connect button
if (!$hmac_login->connect('localhost', 'root', '', 'hmac_login')) {
echo $hmac_login->getLastError();
exit;
}
// $hmac_login->_dbh->debug = true;
$challenge = $hmac_login->getChallenge();
if (!$challenge) {
echo $hmac_login->getLastError();
exit;
}
$hchallenge = htmlspecialchars($challenge);
?>
<script type="text/javascript" language="JavaScript" src="../opt/pajhome.org.uk/md5.js"></script>
<script type="text/javascript" language="JavaScript" src="../lib/StrUtils.js"></script>
<script type="text/javascript" language="JavaScript">
<!-- // <![CDATA[
function form_onsubmit(f) {
f['login'].value = StrUtils.trim(f['login'].value);
示例7: exit
<?php
// $CVSHeader: _freebeer/www/demo/HTTP.ServerPush.php,v 1.3 2004/03/08 04:29:18 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
// \todo fix wget's continuously reporting "End of file while parsing headers."
if (preg_match('/wget/i', $_SERVER['HTTP_USER_AGENT'])) {
echo "<html><body></body></html>";
exit(0);
}
require_once './_demo.php';
require_once FREEBEER_BASE . '/lib/HTTP/ServerPush.php';
$html_header = html_header_demo('fbHTTP_ServerPush Class');
function page_function($push_mode, $seconds = null, $url = null, $loop = 0)
{
$rv = '';
if ($push_mode == FB_HTTP_SERVER_PUSH) {
$rv .= "Content-type: text/html\n\n";
}
global $html_header;
$spaces = '';
#str_repeat('IESUCKS!', 10000);
$time = strftime('%c');
$refresh_method = $push_mode == FB_HTTP_SERVER_PUSH ? 'server push method' : 'HTTP Refresh command';
$a = $_SERVER;
ksort($a);
$s = var_export($a, true);
$rv .= $html_header;
$CVSHeader = '$CVSHeader: _freebeer/www/demo/HTTP.ServerPush.php,v 1.3 2004/03/08 04:29:18 ross Exp $';
$rv .= "The time is {$time}\n<br />\n<br />\n<i>Refresh <!-- {$loop} of {$_REQUEST['loops']} --> every {$_REQUEST['seconds']} seconds using {$refresh_method}</i>\n<pre>\n<form>\nSeconds: <input type='text' name='seconds' value='{$_REQUEST['seconds']}' />\n<!-- \nLoops: <input type='text' name='loops' value='{$_REQUEST['loops']}' />\n-->\n<input type='submit' value='Submit' />\n</form>\n{$s}<!-- {$spaces} --></pre>\nSee\n<br />\n<a target='_blank' href='http://wp.netscape.com/assist/net_sites/pushpull.html'>An Exploration of Dynamic Documents</a>\n</p>\n\n<address>\n{$CVSHeader}\n</address>\n</body>\n</html>\n";
return $rv;
示例8: exit
<?php
// $CVSHeader: _freebeer/www/demo/HTTP.PathInfo(1).php,v 1.3 2004/03/08 04:29:18 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
// \todo fix wget's continuously reporting "End of file while parsing headers."
if (preg_match('/wget/i', $_SERVER['HTTP_USER_AGENT'])) {
echo "<html><body></body></html>";
exit(0);
}
require_once './_demo.php';
require_once FREEBEER_BASE . '/lib/HTTP/PathInfo.php';
fbHTTP_PathInfo::redirect();
session_start();
echo html_header_demo('HTTP/PathInfo class tester', null, null, false);
$url = $_SERVER['SCRIPT_NAME'];
echo "<a href=\"{$url}\">{$url}</a><br />\n";
$url = $_SERVER['REQUEST_URI'];
if (!isset($_SERVER['PATH_INFO'])) {
$url .= '/PATH_INFO';
}
echo "<a href=\"{$url}\">{$url}</a><br />\n";
$url = $_SERVER['REQUEST_URI'];
if (!isset($_SERVER['PATH_INFO'])) {
$url .= '/param1/value1/param2/value2';
}
echo "<a href=\"{$url}\">{$url}</a><br />\n";
echo "<a href=\"get.php\">get.php</a><br />\n";
echo "<pre>";
if (isset($_SESSION)) {
echo '$_SESSION=';
示例9: elseif
//$https->setHttpsPath('');
if (!empty($_REQUEST['http'])) {
$https->httpMe();
} elseif (!empty($_REQUEST['https'])) {
$https->httpsMe();
$https->httpLinkify();
} elseif (!empty($_REQUEST['https_input'])) {
$https->httpsMe();
$https->httpLinkify(true);
}
session_start();
if (isset($_SERVER['HTTP_REFERER']) && !isset($_SESSION['fbHTTPS']['HTTP_REFERER'])) {
$_SESSION['fbHTTPS']['HTTP_REFERER'] = $_SERVER['HTTP_REFERER'];
}
$path = isset($_SESSION['fbHTTPS']['HTTP_REFERER']) ? $_SESSION['fbHTTPS']['HTTP_REFERER'] : '';
echo html_header_demo($title, $path);
echo $https->isHttps() ? 'Secure (HTTPS)' : 'Not secure (HTTP)';
echo '<br />';
$h = $_SERVER['HTTP_HOST'];
$a_hrefs = array();
$delims = array('', '\'', '"');
$urls = array($_SERVER['PHP_SELF'], basename($_SERVER['PHP_SELF']), dirname($_SERVER['PHP_SELF']), dirname($_SERVER['PHP_SELF']) . '/', '.', '/', '');
$hosts = array("", "http://{$h}", "https://{$h}", "http://{$h}:80", "https://{$h}:443");
$a_hrefs = array();
foreach ($hosts as $host) {
foreach ($urls as $url) {
foreach ($delims as $delim) {
if ($host && substr($url, 0, 1) != '/') {
continue;
}
$a_hrefs[] = '<a href=' . $delim . $host . $url . $delim . '>';
示例10: html_header_demo
<?php
// $CVSHeader: _freebeer/www/demo/lib.bin2hex.php,v 1.2 2004/03/07 17:51:34 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
require_once './_demo.php';
echo html_header_demo('JavaScript Bin2Hex Class', '../lib/bin2hex.js');
if (!isset($_REQUEST['t_input'])) {
$_REQUEST['t_input'] = 'enter text to bin2hex here';
}
if (!isset($_REQUEST['t_bin2hex'])) {
$_REQUEST['t_bin2hex'] = '';
}
if (!isset($_REQUEST['t_hex2bin'])) {
$_REQUEST['t_hex2bin'] = '';
}
?>
<script type="text/javascript" language="javascript1.2" src="../lib/bin2hex.js">
</script>
<script type="text/javascript" language="javascript1.2">
<!-- // <![CDATA[
function btn_bin2hex_onclick(f) {
f.t_bin2hex.value = bin2hex(f.t_input.value);
f.t_hex2bin.value = hex2bin(f.t_bin2hex.value);
return false;
}
// ]]> -->
</script>
<form method="post" name='frm_bin2hex'>
<table>
示例11: html_header_demo
<?php
// $CVSHeader: _freebeer/www/demo/Mhash.php,v 1.2 2004/03/07 17:51:33 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
require_once './_demo.php';
require_once FREEBEER_BASE . '/lib/Mhash.php';
echo html_header_demo('fbMhash Class (mhash() Emulation)');
$data = 'data';
$key = 'key';
echo "<pre>\n";
echo "mhash(MHASH_MD5, '{$data}', '{$key}')=", mhash(MHASH_MD5, $data, $key), "\n";
echo "bin2hex(mhash(MHASH_MD5, '{$data}', '{$key}'))= ", bin2hex(mhash(MHASH_MD5, $data, $key)), "\n";
if (class_exists('fbMhash')) {
echo "fbMhash::mhashhex(MHASH_MD5, '{$data}', '{$key}')=", fbMhash::mhashhex(MHASH_MD5, $data, $key), "\n";
}
if (defined('MHASH_SHA1')) {
echo "mhash(MHASH_SHA1, '{$data}', '{$key}')=", mhash(MHASH_SHA1, $data, $key), "\n";
echo "bin2hex(mhash(MHASH_SHA1, '{$data}', '{$key}'))= ", bin2hex(mhash(MHASH_SHA1, $data, $key)), "\n";
if (class_exists('fbMhash')) {
echo "fbMhash::mhashhex(MHASH_SHA1, '{$data}', '{$key}')=", fbMhash::mhashhex(MHASH_SHA1, $data, $key), "\n";
}
}
$hash_map = array(0 => 'MHASH_CRC32', 9 => 'MHASH_CRC32B', 8 => 'MHASH_GOST', 13 => 'MHASH_HAVAL128', 12 => 'MHASH_HAVAL160', 11 => 'MHASH_HAVAL192', 10 => 'MHASH_HAVAL224', 3 => 'MHASH_HAVAL256', 16 => 'MHASH_MD4', 1 => 'MHASH_MD5', 5 => 'MHASH_RIPEMD160', 2 => 'MHASH_SHA1', 17 => 'MHASH_SHA256', 7 => 'MHASH_TIGER', 14 => 'MHASH_TIGER128', 15 => 'MHASH_TIGER160');
$nr = mhash_count();
for ($i = 0; $i < $nr; $i++) {
echo sprintf("The blocksize of %s is %d\n", mhash_get_hash_name($i), mhash_get_block_size($i));
}
?>
</pre>
<address>
示例12: html_header_demo
<?php
// $CVSHeader: _freebeer/www/demo/lib.qsort.php,v 1.2 2004/03/07 17:51:34 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
require_once './_demo.php';
echo html_header_demo('JavaScript QSort Class', '../lib/qsort.js');
?>
<script type="text/javascript" language="JavaScript" src="../lib/qsort.js"></script>
<script type="text/javascript" language="JavaScript">
<!-- // <![CDATA[
var x = new Array();
for (var i = 0; i <= 10; ++i) {
x[i] = Math.floor(65535 * Math.random());
}
document.write('Unsorted: ');
document.write(x.toString());
document.write('<br />Sorted: ');
qsort(x); // , 0, x.length - 1);
document.write(x.toString());
//document.write('\nlength=' + x.length + "<br />\n");
// ]]> -->
</script>
示例13: html_header_demo
<?php
// $CVSHeader: _freebeer/www/demo/Debug.php,v 1.2 2004/03/07 17:51:33 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
require_once './_demo.php';
require_once FREEBEER_BASE . '/lib/Debug.php';
fbDebug::setLevel(FB_DEBUG_ALL);
echo html_header_demo('fbDebug demo');
echo "<pre>\n";
echo 'fbDebug::getLevel()=', fbDebug::getLevel(), "\n";
fbDebug::log('log');
assert('1 == 2');
print_r(debug_backtrace());
fbDebug::stackdump();
fbDebug::trace("Hey you!");
?>
</pre>
<address>
$CVSHeader: _freebeer/www/demo/Debug.php,v 1.2 2004/03/07 17:51:33 ross Exp $
</address>
</body>
</html>
示例14: html_header_demo
<?php
// $CVSHeader: _freebeer/www/demo/lib.jsrpc.php,v 1.2 2004/03/07 17:51:34 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
require_once './_demo.php';
echo html_header_demo('JavaScript RPC (Remote Procedure Call)', './jsrpc/jsrpc2.php');
// \todo classify this logic
?>
<script type="text/javascript" language="JavaScript">
<!-- // <![CDATA[
function serverGetTime() {
var iframe = document.getElementById("COMM");
if (!iframe) {
return true;
}
var answ = document.getElementById("ANSW");
if (!answ) {
return true;
}
iframe.src = "jsrpc/jsrpc2.php";
return false;
}
function handleServerResponse(message) {
var answ = document.getElementById("ANSW");
if (answ) {
answ.innerHTML = 'jsrpc2.php returned "' + message + '"';
}
var iframe = document.getElementById("COMM");
示例15: html_header_demo
<?php
// $CVSHeader: _freebeer/www/demo/lib.base64.php,v 1.2 2004/03/07 17:51:34 ross Exp $
// Copyright (c) 2002-2004, Ross Smith. All rights reserved.
// Licensed under the BSD or LGPL License. See license.txt for details.
require_once './_demo.php';
echo html_header_demo('JavaScript Base64 Class', '../lib/Base64.js');
if (!isset($_REQUEST['t_input'])) {
$_REQUEST['t_input'] = 'enter text to base64 encode here';
}
if (!isset($_REQUEST['t_base64encode'])) {
$_REQUEST['t_base64encode'] = '';
}
if (!isset($_REQUEST['t_base64decode'])) {
$_REQUEST['t_base64decode'] = '';
}
?>
<script type="text/javascript" language="javascript1.2" src="../lib/Base64.js">
</script>
<script type="text/javascript" language="javascript1.2">
<!-- // <![CDATA[
function btn_base64_onclick(f) {
f.t_base64encode.value = Base64.encode(f.t_input.value);
f.t_base64decode.value = Base64.decode(f.t_base64encode.value);
return false;
}
// ]]> -->
</script>
<form method="post" name='frm_base64'>