<?


/*if (!isset($_SESSION)) //判斷是否已經開啟SESSION
{
	header("Cache-control:private");
session_start();
}//開起SESSION}
*/
require_once("../function.php");
/*
check_login();

$mAccount=$_SESSION['mAccount'];

*/
//$aId=$_GET["aId"];
?>
<?php
require_once("db.php");

//接收變數
$mAccount=$_POST['mAccount'];
$password=$_POST['password'];
$cellphone=$_POST['cellphone'];
$email=$_POST['email'];


if(empty($mAccount)||empty($password)||empty($cellphone)||empty($email))
{
	echo "<script>";
	echo "alert(\"有欄位空白!!\");";
	echo "history.go(-1)";
	echo "</script>";
}else{

	$mAccount=nl2br(htmlspecialchars($mAccount));
	$password=nl2br(htmlspecialchars($password));
	$cellphone=nl2br(htmlspecialchars($cellphone));
	$email=nl2br(htmlspecialchars($email));

	//寫入資料庫
	 $str="INSERT INTO MEMBER (MID,PASSWORD,MACCOUNT,CELLPHONE,EMAIL) VALUES (MEM_ID.NEXTVAL,'$password','$mAccount','$cellphone','$email')";
	$inact = oci_parse($conn,$str) or die('Insert error');
	oci_execute($inact);
/*
		echo "
		<html>
        	<head>
        	<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
        	</head>
        	<body>
        	<script language=javascript>
        	alert('註冊成功！');
			
        	location.href='activity_show_detail.php?aId=$aId';
        	</script>
        	</body>
        	</html>
		";

*/
	echo "註冊成功，請從首頁登入 ^.<";
}

?>