-
Notifications
You must be signed in to change notification settings - Fork 0
/
thutuconline.php
51 lines (49 loc) · 1.66 KB
/
thutuconline.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!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=iso-8859-1" />
<title>Untitled Document</title>
</head>
<?php
//Nhan du lieu
$CMND =$_POST["CMND"];
$MATT =$_POST["MATT"];
$TenTT =$_POST["TenTT"];
$HoTen =$_POST["HoTen"];
$GT =$_POST["GT"];
$NgaySinh =$_POST["NgaySinh"];
$NoiSinh =$_POST["NoiSinh"];
$SDT =$_POST["SDT"];
$QuocTich =$_POST["QuocTich"];
$DCThuongTru =$_POST["DCThuongTru"];
$DCTamTru =$_POST["DCTamTru"];
//Nhan file hinh anh
if ($_FILES["file"]["error"] > 0){
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}else{
move_uploaded_file($_FILES["file"]["tmp_name"],"hinhanh/" . $_FILES["file"]["name"]);
echo "Stored in: " . "FILE/" . $_FILES["file"]["name"]. "<br />";
echo "Da upload thanh cong!!!!!!!!!!!!";
$HinhAnh = $_FILES["file"]["name"];
}
$Cha =$_POST["Cha"];
$Me =$_POST["Me"];
$VoChong =$_POST["VoChong"];
//Nhan file hinh anh
//Tao ket noi den server
$conn = mysql_connect("localhost","root","") or die("khong the ket noi");
//Quy d?nh b?ng mã utf8 cho câu truy v?n
mysql_query("SET character_set_results=utf8", $conn);
//Chon CSDL
mysql_select_db("ql_thutuchanhchinh");
//Insert vào CSDL
$query="INSERT INTO DKONLINE values($CMND,$MATT,N'$TenTT',N'$HoTen',N'$GT',$NgaySinh,N'$NoiSinh',$SDT,N'$QuocTich',N'$DCThuongTru',N'$DCTamTru',N'$HinhAnh',N'$Cha',N'$Me',N'$VoChong')";
$result=mysql_query($query);
//Dong ket noi
mysql_close($conn);
//Quay ve trang chu
echo"<meta http-equiv='refresh' content ='3;URL=index.php'>";
?>
<body>
</body>
</html>