WML022.php 2.47 KB
<?php  
//*****************************************************************************
//* 
//* プログラム名:Webメール
//* プログラムID:WML022.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("include/STRING.inc");

//*** JavaScript ***//
include("inc/WML000.inc");

//**** DB接続 ****//
$strDBinc="./include/dbcon.inc";
include($strDBinc);

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;	
}

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

$strSQLview="Select header,subject,comment from mail_get_tbl Where mail_id='".str_replace("'", "''", $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{
	$strHoge=LINE_BR($objview->comment,80);
	$data="<PRE>".link_url($strHoge)."</PRE>";
}
echo $data;

?>