(.+)<\/Zip>
(.+)<\/Pre>(.+)<\/City> (.+)<\/Town>(.+)<\/Address>/", $xml, $m)) { $Zip = $m[1]; $Pre = $m[2]; $City = $m[3]; $Town = $m[4]; $Address = $m[5]; $text = "$Zip,$Pre,$City,$Town,$Address"; } } header("Content-Type:text/plain; charset=UTF-8"); echo $text; exit; } if ($Setup['default_encode'] != "UTF-8") { $keys = array_keys($_REQUEST); foreach ($keys as $key) { $value = $_REQUEST[$key]; if (!array_key_exists($key, $_FILES) && !array_key_exists($key, $_COOKIE)) { $key = mb_convert_encoding($key, "UTF-8", $Setup['default_encode']); $_REQUEST_VALUES[$key] = $value; } } $_REQUEST = $_REQUEST_VALUES; } if ($_REQUEST['CGI_multiparameter']) { $Parameter = array(); if (is_array($_REQUEST['CGI_multiparameter'])) { foreach ($_REQUEST['CGI_multiparameter'] as $line) { $line = str_replace("=", "=", $line); $Param = split(",", $line); $Parameter = array_merge($Parameter, $Param); } } else { $_REQUEST['CGI_multiparameter'] = str_replace("=", "=", $_REQUEST['CGI_multiparameter']); $Parameter = split(",", $_REQUEST['CGI_multiparameter']); } foreach ($Parameter as $line) { list($key, $val) = split("=", $line); if (preg_match("/^[\w]+$/", $key)) { $_REQUEST["CGI_$key"] = $val; } else { $_REQUEST[$key] = $val; } } unset($_REQUEST['CGI_multiparameter']); } $keys = array_keys($_REQUEST); foreach ($keys as $key) { if (preg_match("/^(CGI|CMD)_/", $key, $m)) { $COMMAND_VALUES[] = "$key\t$_REQUEST[$key]"; if ($_REQUEST[$key]) { list($dm, $cmd) = split("_", $key); $Setup[$cmd] = $_REQUEST[$key]; } $_CMD[$key] = $_REQUEST[$key]; } } $Filefields = split(",", $Setup['Filefields']); $now = date("Y/m/d H:i:s"); $_REQUEST['CGI_Status']++; if ($_REQUEST['CGI_Status'] > 1) { if (!strpos($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'])) { $Error = 1; $Error_Message[] = $Language['REFERER_ERROR']; } else { if ($Setup['Mailfield']) { $from = $_REQUEST[$Setup['Mailfield']]; $returnto = $from; } if (!preg_match("/[\w\.\-]+\@[\w\-]+\.[\w\.\-]+/", $from)) { list($id, $server) = split("\@", $Setup['Mailto']); $from = 'nobody@'. $server; } $Csv = array(); $body = "$now\n--\n"; $Csv[] = $now; $Csv[] = mb_convert_encoding($_REQUEST['CGI_Subject'], "SJIS", "UTF-8"); foreach ($keys as $key) { if (!preg_match("/^CGI_/", $key)) { if (arrayMatch($key, $Filefields) && $_REQUEST[$key] && !preg_match("/^sendmail$/", $Setup['Sendmode'])) { $body .= "$key : ". current_Url(). "/tmp/$_REQUEST[$key]\n"; } else { $body .= "$key : $_REQUEST[$key]\n"; } $_REQUEST[$key] = str_replace("=", "=", $_REQUEST[$key]); $Csv[] = mb_convert_encoding(preg_replace("/([\r\n]| )/", "", $_REQUEST[$key]), "SJIS", "UTF-8"); if ($Setup['Returnmsg']) { $Setup['Returnmsg'] = preg_replace("/\%$key\%/", $_REQUEST[$key], $Setup['Returnmsg']); } } } $body = preg_replace("/(\r| |
)/", "\n", $body); if (preg_match("/^sendmail$/i", $Setup['Sendmode'])) { $subject = $Setup['Subject']; $mailbody = $body; if ($Setup['Encode'] != "UTF-8" || $Setup['isoEncoding']) { $subject = subjectiso2022($subject, "UTF-8"); $mailbody = mb_convert_encoding($mailbody, "JIS", "UTF-8"); } foreach ($Filefields as $key) { if ($key && is_file("./tmp/$_REQUEST[$key]")) { $Attachfiles && $Attachfiles .= ","; $Attachfiles .= "./tmp/$_REQUEST[$key]"; } } send_email($Setup['Sendmail'], $subject, $from, $Setup['Mailto'], $mailbody, $Setup['Cc'], $Setup['Bcc'], $Attachfiles); if (preg_match("/yes/i", $Setup['Return']) && preg_match("/[\w\.\-]+\@[\w\-]+\.[\w\.\-]+/", $returnto)) { $subject = "RE: ". $Setup['Subject']; $Setup['Returnmsg'] = preg_replace("/\%body\%/i", $body, $Setup['Returnmsg']); $Setup['Returnmsg'] = preg_replace("/\%.+?\%/", "", $Setup['Returnmsg']); $mailbody = $Setup['Returnmsg']. "\n". $Setup['Signature']; $mailbody = preg_replace("/(\r| )/", "\n", $mailbody); if ($Setup['Encode'] != "UTF-8" || $Setup['isoEncoding']) { $subject = subjectiso2022($subject, "UTF-8"); $mailbody = mb_convert_encoding($mailbody, "JIS", "UTF-8"); } send_email($Setup['Sendmail'], $subject, $Setup['Mailto'], $returnto, $mailbody, '', '', $Setup['Attach']); } } elseif (preg_match("/^smtp$/i", $Setup['Sendmode']) || preg_match("/^qdsendmail$/i", $Setup['Sendmode'])) { /* $to = array( 'to@domein.co.jp' , '宛先日本語名' ); $from = array( 'from@domein.co.jp' , '送り元日本語名' ); $subject = 'メールのテスト(テキスト)'; $attach = array( 'test.jpg' , '添付ファイル名.jpg' ); ライブラリ qdmail.php が必須 */ require_once("php-lib/qdmail.php"); require_once("php-lib/qdsmtp.php"); if (preg_match("/^smtp$/i", $Setup['Sendmode'])) { $param = array( 'host' => $Setup['SMTP'], 'port' => $Setup['Port'], 'from' => $Setup['From'], 'protocol' => $Setup['Authmode'] ); if (preg_match("/POP_BEFORE/i", $Setup['Authmode'])) { $param['pop_host'] = $Setup['SMTP']; $param['pop_user'] = $Setup['Uid']; $param['pop_pass'] = $Setup['Upw']; } elseif (preg_match("/SMTP_AUTH/i", $Setup['Authmode'])) { $param['user'] = $Setup['Uid']; $param['pass'] = $Setup['Upw']; } $Option = array('type'=>'text','smtp'=>$param); } else { $Option = "text"; } qd_send_mail($Option, array($Setup['Mailto']), $Setup['Subject'], $body , array($from)); if (preg_match("/yes/i", $Setup['Return']) && $Setup['Returnmsg'] && preg_match("/[\w\.\-]+\@[\w\-]+\.[\w\.\-]+/", $returnto)) { $Setup['Returnmsg'] = preg_replace("/\%body\%/i", $body, $Setup['Returnmsg']); qd_send_mail($Option, array($returnto), "RE: ".$Setup['Subject'], $Setup['Returnmsg']."\n".$Setup['Signature'], array($Setup['Mailto'])); } } else { /* PHP mail コマンドによる送信 自動返信に添付は不可 Commands sent by PHP maul Not attached to the automatic reply */ $subject = subjectiso2022($Setup['Subject'], "UTF-8"); $headers = "From: $from\n"; $Setup['Cc'] && $headers .= "Cc: ".$Setup['Cc']."\n"; $Setup['Bcc'] && $headers .= "Bcc: ".$Setup['Bcc']."\n"; $Setup['Replyto'] && $headers .= "Reply-To: ".$Setup['Replyto']."\n"; $mailbody = preg_replace("/(\r| )/", "\n", mb_convert_encoding($body, "JIS", "UTF-8")); mail($Setup['Mailto'], $subject, $mailbody, $headers); if (preg_match("/yes/i", $Setup['Return']) && $Setup['Returnmsg'] && preg_match("/[\w\.\-]+\@[\w\-]+\.[\w\.\-]+/", $returnto)) { $subject = subjectiso2022("RE: ".$Setup['Subject'], "UTF-8"); $Setup['Returnmsg'] = preg_replace("/\%body\%/i", $body, $Setup['Returnmsg']); $mailbody = preg_replace("/(\r| )/", "\n", mb_convert_encoding($Setup['Returnmsg']."\n".$Setup['Signature'], "JIS", "UTF-8")); mail($returnto, $subject, $mailbody, "From: ".$Setup['Mailto']."\n"); } } if ($Setup['Csvfile']) { $handle = fopen($Setup['Csvfile'], "a"); fputcsv($handle, $Csv); fclose($handle); } if ($Setup['Publicfile']) { /* 共通ファイルへの保存 Save to a common file */ unset($Csv); $Csv[] = mb_convert_encoding($Setup['Subject'], "SJIS", "UTF-8"); $Csv[] = $now; foreach ($CSV_Fields as $field) { $Csv[] = mb_convert_encoding(preg_replace("/([\r\n]| )/", "", $_REQUEST[$field]), "SJIS", "UTF-8"); } $handle = fopen($Setup['Publicfile'], "a"); fputcsv($handle, $Csv); fclose($handle); } if ($Setup['Gopage']) { header("Location: ".$Setup['Gopage']); exit; } $Message['caption'] = $Language['SEND_OK_BUTTON']; $Message['body'] = $Setup['Thankyou']; } } else { $Connectfields = split(";", $Setup['Connectfield']); $Comparisonfields = preg_split("/;/", $Setup['Comparison']); $Hiddenfields = split(",", $Setup['Hidden']); $Checkfields = split(",", $Setup['Check']); if ($Setup['Check'] && count($Checkfields)) { foreach ($Checkfields as $key) { if ($key == $Setup['Mailfield']) { if (!preg_match("/[\w\.\-]+\@[\w\-]+\.[\w\.\-]+/", $_REQUEST[$key])) { $Error_fields[] = $key; $Error = 1; } } elseif ($_REQUEST[$key] == "") { $Error_fields[] = $key; $Error = 1; } } } foreach ($keys as $key) { if (arrayMatch($key, $Filefields) && $_FILES[$key]) { !is_dir("./tmp") && mkdir("./tmp"); if ($dh = opendir("./tmp")) { while (($file = readdir($dh)) !== false) { if (filetype("./tmp/$file") == "file") { !$Setup['Filelimit'] && $Setup['Filelimit'] = 7; if (filemtime("./tmp/$file") + $Setup['Filelimit'] * 86400 < time()) unlink("./tmp/$file"); } } closedir($dh); } $timestamp = date("YmdHis"); if ($_FILES[$key]['name']) { $filename = $_FILES[$key]['name']; move_uploaded_file($_FILES[$key]['tmp_name'], "./tmp/$_FILES[$key]['name']"); $_REQUEST[$key] = $filename; if (arrayMatch($key, $Checkfields)) $check = 1; $REQUEST_VALUES[] = "$key\t$_REQUEST[$key]\t$check"; } } elseif (!$_FILE[$key] && !$_COOKIE[$key] && !preg_match("/^CGI_/", $key)) { $check = 0; $order = 0; if ($dummy = array_values(preg_grep("/,$key/", $Connectfields))) { $Fields = split(",", $dummy[0]); $fieldcnt = count($Fields); $field = ""; for ($i = 2; $i < $fieldcnt; $i++) { $field && $field .= $Fields[1]; $field .= $_REQUEST[$Fields[$i]]; } $i = 0; foreach ($Connectfields as $val) { if (preg_match("/,$key/", $val)) { array_splice($Connectfields, $i, 1); break; } $i++; } $key = $Fields[0]; $_REQUEST[$key] = $field; $order = 1; } elseif (is_array($_REQUEST[$key])) { $field = implode("/", $_REQUEST[$key]); $field = preg_replace("/\/$/", "", $field); unset($_REQUEST[$key]); $_REQUEST[$key] = $field; $order = 1; } elseif (!arrayMatch($key, $Hiddenfields)) { $order = 1; } if ($order) { if (arrayMatch($key, $Checkfields)) $check = 1; $REQUEST_VALUES[] = "$key\t$_REQUEST[$key]\t$check"; } } } foreach ($Comparisonfields as $val) { list($a, $b) = split(",", $val); if ($_REQUEST[$a] != $_REQUEST[$b]) { $Error_Comparison[] = $a. "と". $b; $Error = 1; } } } $Setup['sort'] && sort($REQUEST_VALUES); if (preg_match("/^\//", $Setup['Template'])) { $Setup['Template'] = $_SERVER['DOCUMENT_ROOT']. $Setup['Template']; } if (!$Setup['Template'] || !is_file($Setup['Template'])) { $Html = split("\n", defaltHtml()); } else { $Html = file($Setup['Template']); } $contents = 0; unset($document); $scriptname = basename($_SERVER['SCRIPT_NAME']); $encoding = $Encoding[$Setup['Encode']]; header("Content-Type: text/html; charset=$encoding"); foreach ($Html as $line) { if (preg_match("/()/i", $line, $m)) { $tg = $m[0]; $separator = $m[1]; $separator = str_replace("?", '\?', $separator); $ssi = $m[2]; list($leftdoc, $rightdoc) = split($separator, $line); if ($ssi) { list($exe, $param) = split("\?", $ssi); if ($Init['ssiurl']) { $url = $System['protocol']. $_SERVER['SERVER_NAME']. $ssi; $ssitext = file_get_contents($url); } else { $url = $_SERVER['DOCUMENT_ROOT']. $ssi; if (is_file($_SERVER['DOCUMENT_ROOT']. $ssi)) { $ssitext = file_get_contents($url); } } } $line = str_replace($tg, $ssitext, $line); } if (preg_match("//i", $line)) { $contents = 0; } elseif (preg_match("//i", $line) && $id10) { $contents = 1; if (!COUNT($_POST) && !COUNT($_GET)) { $Error = true; $Errmsg = "送信するデータが有りません。"; } if ($Error) { if ($Setup['Homepage']) { $homeButton = " "; } $document = " "; } elseif ($Message['caption']) { $Message['body'] = preg_replace("/[\r\n]/", "
", $Message['body']); if ($Setup['Homepage']) { $homeButton = ""; } $document = " "; } else { $document = " "; } $Setup['Encode'] != "UTF-8" && $document = mb_convert_encoding($document, $Setup['Encode'], "UTF-8"); echo $document; } elseif (!$contents) { echo $line; } } exit; ?>