標準化仕様の調整 (V)


  common.php




クッキーの対応を行なっています

  

<?
header( "Content-Type: text/html; Charset=shift_jis" );
header( "Expires: Wed, 31 May 2000 14:59:58 GMT" );

foreach( $_GET as $Key => $Value ) {
	$_POST[$Key] = $_GET[$Key];
}
foreach( $_POST as $Key => $Value ) {
	$_POST[$Key] = str_replace("\\\\", "\\", $Value );
}
foreach( $_POST as $Key => $Value ) {
	if ( substr( $Key, 0, 2 ) == 'In' ) {
		setcookie( $Key, $_POST[$Key] );
	}
}

# **********************************************************
# 環境
# **********************************************************
define( 'COMMON_AUTHOR', 'LIGHTBOX' );
$COMMON_VERSION = '3.0628';

# **********************************************************
# クッキーデータの復帰
# **********************************************************
function RestoreQookie( ) {

	foreach( $_COOKIE as $Key => $Value ) {
		if ( substr( $Key, 0, 2 ) == 'In' ) {
			if ( !isset( $_POST[$Key] ) ) {
				$_POST[$Key] = $_COOKIE[$Key];
			}
		}
	}

}

# **********************************************************
# エラーメッセージのセット
# **********************************************************
function SetError( $Message ) {

	$GLOBALS['ErrMessage'] = $Message;

}

# **********************************************************
# オプション文字列の作成
# **********************************************************
function CreateOption( &$SQL, $FieldName, $Query ) {

	$Column = $SQL->QueryEx( $Query );

	$Ret = "";
	while ( $Column ) {
		$Ret .= "<OPTION value={$Column[0]}";
		if ( $Column[0] == $_POST[$FieldName] ) {
			$Ret .= " selected";
		}
		$Ret .= ">{$Column[1]}</OPTION>\n";
		$Column = $SQL->QueryEx( );
	}

	return $Ret;

}

# **********************************************************
# リダイレクト
# **********************************************************
function Redirect( $Target ) {

	header( "Location: $Target" );

}

# **********************************************************
# キャラクタセットを指定するMETAタグ文字列作成関数
# **********************************************************
function MetaCharset( $Target ) {

	$strRet = '<META';
	$strRet .= ' http-equiv="Content-type"';
	$strRet .= " content=\"text/html; charset=$Target\">";

	return $strRet;

}

# **********************************************************
# 挟み込み関数
# **********************************************************
function Enclose( $strValue, $Chr, $Type, $Option="" ) {

	$strRet = "";

	switch( $Type ) {
		# 単純挟み込み
		case 0:
			$strRet = $Chr . $strValue . $Chr;
			break;
		# HTML挟み込み
		case 1:
			$strRet = "<" . $Chr . " " . $Option . ">";
			$strRet .= $strValue;
			$strRet .= "</" . $Chr . ">";
			break;
	}

	return $strRet;

}

# **********************************************************
# ' 挟み込み関数
# **********************************************************
function Ss( $strValue ) {

	return Enclose( $strValue, "'", 0 );

}

# **********************************************************
# " 挟み込み関数
# **********************************************************
function Dd( $strValue ) {

	return Enclose( $strValue, "\"", 0 );

}

# **********************************************************
# <TH> 挟み込み関数
# **********************************************************
function Th( $strValue, $Option="" ) {

	return Enclose( $strValue, "TH", 1, $Option );

}

# **********************************************************
# <TD> 挟み込み関数
# **********************************************************
function Td( $strValue, $Option="" ) {

	return Enclose( $strValue, "TD", 1, $Option );

}

# **********************************************************
# <A href> 挟み込み関数
# **********************************************************
function Alink( $Url, $strValue, $Option="" ) {

	return Enclose( $strValue, "A", 1, "href=" . Dd($Url) . " " . $Option );

}

# **********************************************************
# <DIV> 挟み込み関数
# **********************************************************
function Div( $strValue, $Option="" ) {

	return Enclose( $strValue, "DIV", 1, $Option );

}

# **********************************************************
# 改行付表示関数
# **********************************************************
function OutCr( $strValue ) {

	print $strValue . "\n";

}

# **********************************************************
# タイトル表示関数
# **********************************************************
function DispTitle( $strTitle ) {

	$strValue = Div( $strTitle, "style='margin-top:5'" );
	$strValue = Div( $strValue, "class=SYSTEM_TITLE" );

	OutCr( $strValue );

}

# **********************************************************
# ウインドウ最大化JavaScript出力関数
# **********************************************************
function MaxWindow( ) {

	OutCr( '<!-- ' . str_repeat("*", 75) );
	OutCr( ' ページロード時の初期処理' );
	OutCr( str_repeat("*", 76) . ' -->' );
	OutCr( '<SCRIPT FOR=window EVENT=onload LANGUAGE=JavaScript>' );
	OutCr( '' );
	OutCr( '	window.focus();' );
	OutCr( '	top.moveTo( 0, 0 );' );
	OutCr( '	top.resizeTo( screen.width, screen.height - 32 );' );
	OutCr( '' );
	OutCr( '</SCRIPT>' );

}

# **********************************************************
# デバッグ用情報表示関数
# **********************************************************
function DispHash( &$Hash, $strTitle="" ) {

	$Option = "bgcolor=white";

	OutCr( "<TABLE border=0 bgcolor=black cellspacing=1>" );
	OutCr( Th( "$strTitle 名称", "bgcolor=silver" ) );
	OutCr( Th( 内容, "bgcolor=silver" ) );
	foreach( $Hash as $Key => $Value ) {
		OutCr( "<TR>" );
		OutCr( Td( $Key, $Option ) );
		OutCr( Td( $Value, $Option ) );
		OutCr( "</TR>" );
	}
	OutCr( "</TABLE>" );

}

# **********************************************************
# デバッグ用情報表示関数
# **********************************************************
function DispDebug( $strType="MISS" ) {

	$TableTag = "<TABLE border=0 bgcolor=black cellspacing=1>";
	$Err = "デバッグ用情報表示関数への引数が誤っています";
	$Option = "bgcolor=white";

	switch( $strType ) {
		case "VER":
			OutCr( $TableTag );
			OutCr( Th( "現在のPHPバージョン", "bgcolor=silver" ) );
			OutCr( "<TR>" );
			OutCr( Td( phpversion(), $Option ) );
			OutCr( "</TR>" );
			OutCr( "</TABLE>" );
			break;

		case "POST":
			DispHash( $_POST, "POST" );
			break;

		case "GET":
			DispHash( $_GET, "GET" );
			break;

		case "SESSION":
			if ( isset( $_SESSION ) ) {
				DispHash( $_SESSION, "SESSION" );
			}
			break;

		case "ENV":
			DispHash( $_ENV, "ENV" );
			break;

		case "SERVER":
			DispHash( $_SERVER, "SERVER" );
			break;

		case "COOKIE":
			DispHash( $_COOKIE, "COOKIE" );
			break;

		case "REQUEST":
			DispHash( $_REQUEST, "REQUEST" );
			break;

		default:
			OutCr( $TableTag );
			OutCr( Th( $Err, $Option ) );
			OutCr( "</TABLE>" );
			break;
	}

}

# **********************************************************
# デバッグ用メッセージの表示
# **********************************************************
function DispData() {

	DispHash( $_GET, "GET" );
	DispHash( $_POST, "POST" );
	DispHash( $_COOKIE, "COOKIE" );
	if ( isset( $_SESSION ) ) {
		DispHash( $_SESSION, "SESSION" );
	}

}

# **********************************************************
# デバッグ用メッセージの表示
# **********************************************************
function DispArray( &$Array ) {

	OutCr( "<PRE>" );
	print_r( $Array );
	OutCr( "</PRE>" );

}
?>
  










yahoo  google  MSDN  MSDN(us)  WinFAQ  Win Howto  tohoho  ie_DHTML  vector  wdic  辞書  天気 


[webclass]
CCBot/2.0 (https://commoncrawl.org/faq/)
19/06/21 00:38:55
InfoBoard Version 1.00 : Language=Perl

BatchHelper COMprog CommonSpec Cprog CprogBase CprogSAMPLE CprogSTD CprogSTD2 CprogWinsock Cygwin GameScript HTML HTMLcss InstallShield InstallShieldFunc JScript JScriptSAMPLE Jsfuncs LLINK OldProg OracleGold OracleSilver PRO PRObrowser PROc PROconePOINT PROcontrol PROftpclient PROjscript PROmailer PROperl PROperlCHAT PROphp PROphpLesson PROphpLesson2 PROphpLesson3 PROphpfunction PROphpfunctionArray PROphpfunctionMisc PROphpfunctionString PROsql PROvb PROvbFunction PROvbString PROvbdbmtn PROvbonepoint PROwebapp PROwin1POINT PROwinSYSTEM PROwinYOROZU PROwindows ProjectBoard RealPHP ScriptAPP ScriptMaster VBRealtime Vsfuncs a1root access accreq adsi ajax amazon argus asp aspSample aspVarious aspdotnet aw2kinst cappvariety centura ckeyword classStyle cmaterial cmbin cmdbapp cmenum cmlang cmlistbox cmstd cmstdseed cmtxt cs daz3d db dbCommon dbaccess dnettool dos download flex2 flex3 flex4 framemtn framereq freeWorld freesoft gimp ginpro giodownload google hdml home hta htmlDom ie9svg install java javaSwing javascript jetsql jquery jsp jspTest jspVarious lightbox listasp listmsapi listmsie listmsiis listmsnt listmspatch listmsscript listmsvb listmsvc memo ms msde mysql netbeans oraPlsql oracle oracleWiper oraclehelper orafunc other panoramio pear perl personal pgdojo pgdojo_cal pgdojo_holiday pgdojo_idx pgdojo_ref pgdojo_req php phpVarious phpguide plsql postgres ps r205 realC realwebapp regex rgaki ruby rule sboard sc scprint scquest sdb sdbquest seesaa setup sh_Imagick sh_canvas sh_dotnet sh_google sh_tool sh_web shadowbox shgm shjquery shvbs shweb sjscript skadai skywalker smalltech sperl sqlq src systemdoc tcpip tegaki three toolbox twitter typeface usb useXML vb vbdb vbsfunc vbsguide vbsrc vpc wcsignup webanymind webappgen webclass webparts webtool webwsh win8 winofsql wmi work wp youtube