<?php var_dump($_POST); 

session_start();
header("Content-type: text/html; charset=".$_SESSION['encodingmode']);
if($_SESSION['dbName']==""){
header("location:../index.php");
}


include("config.inc.php");
include("function.inc.php");



$connection = mysql_connect($config['dbServer'],$config['dbUser'],$config['dbPass']) or die("Could not connect to DB");
mysql_select_db($_SESSION['dbName'],$connection) or die("Could not find DB");

if(	$_SESSION['encodingmode'] == 'utf8' || $_SESSION['encodingmode'] == 'utf-8'){
	mysql_query("SET NAMES 'utf8'"); 
	mysql_query('SET CHARACTER SET utf8'); 
	mysql_set_charset('utf8', $connection);
}
   
 echo"<BR>".$querySlip = "select count(*) from SlipPassed where SlipNumber = '$txtKeyword'";
 $resSlipNo = mysql_query($querySlip, $connection);
 $rowSlipNo = mysql_fetch_array($resSlipNo);
 if($rowSlipNo[0] > 0){
	$message = "Warning : Duplicated Slip Number !!!";
 }else{
	$InsQuery = "INSERT INTO `slippassed` (`id`, `SlipNumber`, `slip_date`) VALUES (null, '$txtKeyword', now() )";
	$resSlipNo = mysql_query($InsQuery, $connection)or die(mysql_error());
	if($resSlipNo)
		$message = "Slip Passed Successfully";
 }
	header ("Location: ./Form_slipPass.php?message=".$message);
	

?>