MIL022.php 2.16 KB
<?php  

	@putenv("TZ=JST-9");
	header('Content-Type: text/html; charset=EUC-JP');
	header('Pragma: no-cache');
	header('Cache-Control: no-cache');

	include("include/session_start.inc");
	include("include/SessionChk.inc");
	include("inc/MIL001.inc");
	include("inc/MIL002.inc");

	$strDBinc="include/dbcon.inc";
	include($strDBinc);

	//メールの詳細取得
	$view_uid=subRetURI($_GET['view_uid']);

	$strSQLview="Select header,subject,comment from mail_get_tbl Where mail_id='".addslashes($view_uid)."' and syain_cd='$PHP_SYAIN_CD'";
	
	//メール情報取得
	$objRecview = pg_exec($strSQLview);
	if($objRecview==false){
		echo("SQL実行に失敗しました(SELECT)");
		exit;
	}
	$objview = pg_fetch_object($objRecview, 0);
	

	list($raw_header, $body) = split("\r?\n\r?\n", $data, 2);	 

	$raw_header=$objview->header;

	$header_list = parse_header($raw_header);

	$ctype = parse_ctype($header_list['content-type']);

	//HTLMメールの場合
	if ($ctype['type'] == 'multipart') {
		$html_flg= 1;
	}else if($ctype['subtype'] == 'html'){
		$html_flg= 1;
	}else{
		$html_flg= 0;
	}
	
	$view_data = $objview->comment;
	$html_flg=0;
	if(ereg("<html>",strtolower($view_data))){$html_flg=1;
	}elseif(ereg("<body>=",strtolower($view_data))){$html_flg=1; 
	}elseif(ereg("<head>",strtolower($view_data))){$html_flg=1;
	}elseif(ereg("</SCRIPT>=",strtolower($view_data))){$html_flg=1;
	}elseif(ereg("<bgcolor",strtolower($view_data))){$html_flg=1;
	}elseif(ereg("<input",strtolower($view_data))){$html_flg=1;
	}elseif(ereg("<font",strtolower($view_data))){$html_flg=1;
	}elseif(ereg("<CENTER>",strtolower($view_data))){ $html_flg=1;
	}

	if($html_flg==1){
		$data=$objview->comment;
	}else{	 
		$data="<PRE>".link_url($objview->comment)."</PRE>";
	}
	echo $data;

function subRetURI($prmStr){

	$prmStr = str_replace("EgruProPlus", "+", $prmStr);
	$prmStr = str_replace("EgruProAnp", "&", $prmStr);
	$prmStr = str_replace("EgruProPer", "%", $prmStr);
	$prmStr = str_replace("EgruProNum", "#", $prmStr);
	$prmStr = str_replace("EgruProSing", "'", $prmStr);
	$prmStr = str_replace("EgruProDoub", '"', $prmStr);		
	$prmStr = str_replace("EgruProDoll", "$", $prmStr);		
	$prmStr = str_replace("EgruProhyph", "-", $prmStr);		
	return $prmStr;	
}

?>