 |
|
Code (PHP)
<?php
session_start();
include('../include/config.php');
?>
<!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>
</head>
<?php
$name=$_POST['txtname'];
$surname=$_POST['txtsurname'];
$institute=$_POST['txtinstitute'];
$floor=$_POST['txtfloor'];
$building=$_POST['txtbuilding'];
$data=$_POST['txtdata'];
$data1=$_POST['txtdata1'];
$data2=$_POST['txtdata2'];
$data3=$_POST['txtdata3'];
$data4=$_POST['txtdata4'];
$num=$_POST['num'];
$num1=$_POST['num1'];
$num2=$_POST['num2'];
$num3=$_POST['num3'];
$num4=$_POST['num4'];
$date=date("D-m-y H:i:s");
// ปิดการทำงานทังหมด
$sql1="SELECT * FROM `member` ";//เรียกใช้ section
$sqlquery=mysql_query($sql1);
$read=mysql_fetch_array($sqlquery);
$sql="INSERT INTO rent (name,surname,institute,floor,building,rentname,rentname1 ,rentname2,rentname3 ,rentname4,num ,num1,num2, num3,num4,date)VALUES('$name','$surname','$institute','$floor','$building','$data','$data1','$data2','$data3','$data4','$num','$num1','$num2','$num3','$num4','$date')";
//$sqlquery=mysql_query($sql1);
//echo $sql; // ถ้าอยากรู้ว่าส่งค่าตัวแปรมาถูกหรือป่าวก็
$sqlquery = mysql_query($sql) or die(mysql_error());
if($sqlquery)
{
echo'<script>alert("ทำเรื่องเบิกครุภัณฑ์เรียบร้อยแล้ว");window.location="reportout.php";</script>';
?>
<?php
}
else
{
echo'<script>alert("การเบิกครุภัณฑ์เกิดข้อผิดพลาดกรุณาลองใหม่");window.location="outasset.php";</script>';
?>
<?php
}
?>
<body>
</body>
</html>
Tag : PHP
|
|
 |
 |
 |
 |
Date :
2010-08-20 07:47:05 |
By :
ผู้หญิงสีดำ |
View :
793 |
Reply :
6 |
|
 |
 |
 |
 |
|
|
|
 |