WML022.php
2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?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;
?>