CON015_1_1.php 1.28 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:POP3情報DB設定処理
//* プログラムID:CON0015_1_1
//* 機能        :POP3をDB設定する
//* 作成者      :
//* 
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");

//*****************************************************************************
//* インクルードファイル
//*****************************************************************************
include("include/session_start.inc");							//セッション開始
include("include/SessionChk.inc");								//セッションチェック
include("include/dbcon.inc");											//DB接続

//新規登録
if ($_POST["srv_id"] == "") {
	$strSql = "SELECT MAX(srv_id) as a FROM mailadmin_tbl";
	$rsResult = pg_exec($pg_con,$strSql);
	$intPop3NextValue = pg_result($rsResult,0,"a") + 1;
	$strSql = "INSERT INTO mailadmin_tbl VALUES(";
	$strSql = $strSql."'$intPop3NextValue',2,'".addslashes($_POST["pop3_name"])."')";
	$rsResult = pg_exec($pg_con,$strSql);
//修正
}else{
	$strSql = "UPDATE mailadmin_tbl SET ";
	$strSql .= "srv_add='".addslashes($_POST["pop3_name"])."' ";
	$strSql .= "WHERE srv_id =".$_POST["srv_id"] ;
	$rsResult = pg_exec($pg_con,$strSql);
}

header("Location: CON015.php");
?>