◀ Previous Next ▶ Up ▲


ผมแอดข้อมูลไม่เข้าฐานข้อมูลครับมันเออเร่อ ผมแอดข้อมูลลง3ตารางอ่ะครับไม่รู้ผิดตรงไหนบ้างรบกวนผู้รู้นะครับ

<? session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
background-color: #CCCAAA;
}
.style2 {
font-size: 14px;
font-family: Arial, Helvetica, sans-serif;
}
.style3 {font-size: 12px}
-->
</style></head>

<?php
session_start(); //เปิด session
$ses_admin1id =$_SESSION[ses_admin1id]; //สร้าง session สำหรับเก็บค่า ID
$ses_admin1usn = $_SESSION[ses_admin1usn]; //สร้าง session สำหรับเก็บค่า username
//ตรวจสอบว่าทำการ Login เข้าสู่ระบบมารึยัง
if($ses_admin1id <> session_id() or $ses_admin1usn==""){
echo "โปรดทำการเข้าสู่ระบบ<br />";
}
//ตรวจสอบสถานะว่าใช่ admin รึเปล่า ถ้าไม่ใช่ให้หยุดอยู่แค่นี้
if($_SESSION[ses_status] != "admin1") {
echo "สำหรับ Admin เท่านั้น";
echo "<meta http-equiv='refresh' content=2;url='admin_login.php'>";
exit();
}
?>




<body><div id="body" align="center">
<table width="1024" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4" bgcolor="#FFFFFF"><img src="imgs/banner.jpg" width="1024" height="50" /><br />
<img src="imgs/admin_checklogin.php" width="1024" height="5" /></td>
</tr>
<tr valign="top">
<td width="125" bgcolor="#FFFFFF"><a href="admin1_seeall_user.php"><img src="imgs/menu_admin1.jpg" width="125" height="30" border="0" align="top" /></a><br />
<a href="admin1_manage.php"><img src="imgs/menu_admin2.jpg" width="125" height="30" border="0" /></a><br />
<a href="admin1_add_user.php"><img src="imgs/menu_admin3.jpg" width="125" height="30" border="0" /></a><br />
<a href="admin1_report.php"><img src="imgs/menu_admin4.jpg" width="125" height="30" border="0" /></a><br />
<a href="admin1_search_user.php"><img src="imgs/menu_admin5.jpg" width="125" height="30" border="0" /></a><br />
<a href="admin_logout.php"><img src="imgs/menu_logout.jpg" width="125" height="30" border="0" /></a></a><br /></td>
<td width="899" colspan="3" bgcolor="#FFFFFF"><p>&nbsp;</p>
<p align="center" class="style2">เพิ่มข้อมูลลูกค้า</p>
<p align="center"><img src="imgs/Add-user-icon.png" width="48" height="48" /></p>
<form id="form1" name="form1" method="post" action="">
<div align="center">


<?php


// Hotel and casino details from casino update form
$bs_company = $_POST['bs_company'];
$bs_typeb = $_POST['bs_typeb'];
$bs_sex = $_POST['bs_sex'];
$bs_name = $_POST['bs_name'];
$bs_surname = $_POST['bs_surname'];
$bs_address = $_POST['bs_address'];
$bs_address2 = $_POST['bs_address2'];
$bs_city = $_POST['bs_city'];
$bs_zipcode = $_POST['bs_zipcode'];
$bs_tel = $_POST['bs_tel'];
$bs_email = $_POST['bs_email'];
$bs_pfrom = $_POST['bs_pfrom'];
// Games from the casino update form
$pro_sn = $_POST['pro_sn'];
$pro_name = $_POST['pro_name'];
// Resaurant in the casino update form
$bill_date = $_POST['bill_date'];
// connect to mysql
$conn = mysql_connect("localhost", "root", "1234")
or die("ERR: Connection");

// connect to database
$db = mysql_select_db("bs", $conn)
or die("ERR: Database");
mysql_query("set character_set_results = utf8") or die(mysql_error());
mysql_query("set names utf8") or die(mysql_error());
// create mysql query
// Insert a row of information into the table "casino_tbl"
$sql = "INSERT INTO member (bs_id, bs_company, bs_typeb, bs_sex, bs_name, bs_surname, bs_address, bs_address2, bs_city, bs_zipcode,bs_tel,bs_email,bs_pfrom)
VALUES('".$bs_id."', '".$bs_company."', '".$bs_typeb."', '".$bs_sex."', '".$bs_name."', '".$bs_surname."', '".$bs_address."', '".$bs_address2."', '".$bs_city."', '".$bs_zipcode."', '".$bs_tel."', '".$bs_email."', '".$bs_pfrom."')";

// execute query
$exec = mysql_query($sql, $conn)or die(mysql_error());

$sql_1 = "INSERT INTO bill (bill_id, bill_date, bill_bs_id, bill_pro_id)
VALUES('".$bill_id."', '".$bill_date."', '".$bill_bs_id."', '".$bill_pro_id."')";

// execute query
$exec = mysql_query($sql_1, $conn)or die(mysql_error());

$sql_2 = "INSERT INTO program (pro_id, pro_sn, pro_name)
VALUES('".$pro_id."', '".$pro_sn."', '".$pro_name."')";

// execute query
$exec = mysql_query($sql_2, $conn)or die(mysql_error());


echo ("เพิ่มข้อมูลสำเร็จ");

?>

<meta http-equiv="refresh" content="2;url=admin1_manage.php">

<br />
</div>
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p></td>
</tr>
</table>
</div>

</body>
</html>


จากคุณ : Tee -[ 27 ธ.ค. 55 - 13:45:25 A:192.168.0.82 X:125.25.47.199 ]



Share/Save/Bookmark





กระทู้ยอดนิยม