* Login   * Register


Last visit was:
It is currently Fri Jun 22, 2018 4:37 pm
View unanswered posts
View active topics





Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Tai lieu tham khao thi cuoi hoc ky
PostPosted: Tue Jun 02, 2009 8:48 pm 
Offline
User avatar

Joined: Sun Mar 08, 2009 12:34 am
Posts: 23
//Xu ly sua
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Xu ly sua</title>
</head>
<body>
<?php
require ("ketnoi.php");
$MASV=$_POST["MASV"];
$TENSV=$_POST["TENSV"];
$NGSINH=$_POST["NGSINH"];
$NOISINH=$_POST["NOISINH"];
$DIACHI=$_POST["DIACHI"];
$phai=$_POST["phai"];
$sql="update SV set TENSV='$TENSV',NGSINH='$NGSINH',NOISINH='$NOISINH',DIACHI='$DIACHI',GIOITINH='$phai' Where MASV='$MASV'";
$kq=mysql_query($sql,$lk);
include("Trang giao dien sua.php");
?>
<script>
alert("Chúc mừng bạn đã sửa thành công!");
</script>
</body>
</html>

//Xu ly dang nhap
<?
require("ketnoi.php");
$username=$_POST["username"];
$password=$_POST["password"];
$sql="select*from USER where username='$username' && password='$password'";
$kq=mysql_query($sql,$lk);
if(mysql_num_rows($kq)>0)
{
require("Trang chinh.php");
?>
<script>
{
alert("Welcome <?echo("$username, ")?>Bạn đã đănng nhập thành công!");
}
</script>
<?
}
else
{
require("index.php");
?>
<script>
{
alert("Bạn đã đănng nhập không thành công! Vui lòng đăng nhập lại...");
}
</script>
<?
}
?>

//Xu ly dang ki
<html>
<?
require("ketnoi.php");
$username=$_POST["user"];
$password=$_POST["pass"];
$email=$_POST["email"];
$diachi=$_POST["diachi"];
$phai=$_POST["Phai"];
$sql="select*from USER Where username='$username'";
$kq=mysql_query($sql,$lk);
if(mysql_num_rows($kq)>0)
{
require("Dang ki.php");
?>
<script>
alert("<?echo("$username")?> Đã tồn tại, Vui lòng đăng kí lại...Thanks...");
</script>
<?
}
else
{
$sql="insert into USER(username,password,email,diachi,phai)value('$username','$password','$email','$diachi','$phai')";
require("Trang chinh.php");
?>
<script>
alert("Welcome <?echo("$username, ")?>Bạn đã đănng kí thành công!");
</script>
<?
}
?>
</html>
//Xu ly xoa
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Xóa</title>
</head>
<body>
<?php
require ("ketnoi.php");
$MASV=$_POST["MASV"];
$sql="delete from SV Where MASV='$MASV'";
$kq=mysql_query($sql,$lk);
include("Trang giao dien xoa.php");
?>
<script>
alert("Bạn đã xóa thành công");
</script>
</body>
</html>

//Load du lieu len
<!--load du lieu len-->
<center>
<?
require("ketnoi.php");
$sql="select * from SV";
$kq=mysql_query($sql,$lk);
if(mysql_num_rows($kq)>0)
{
echo"<table border=1><tr><td>MASV</td>";
echo"<td>TENSV</td>";
echo"<td>NGSINH</td>";
echo"<td>NSINH</td>";
echo"<td>DIACHI</td>";
echo"<td>PHÁI</td>";
while($dong=mysql_fetch_array($kq))
{
$MASV=$dong["MASV"];
$TENSV=$dong["TENSV"];
$NGSINH=$dong["NGSINH"];
$NOISINH=$dong["NOISINH"];
$DIACHI=$dong["DIACHI"];
$phai=$dong["GIOITINH"];
echo"<tr><td>$MASV</td>";
echo"<td>$TENSV</td>";
echo"<td>$NGSINH</td>";
echo"<td>$NOISINH</td>";
echo"<td>$DIACHI</td>";
echo"<td>$phai</td></tr>";
}
echo"</table>";

}
?>
</center>

//Kiem tra xem co nhap vo hay chua
<script type="text/Javascript">
function checkinput()
{
if(document.form1.username.value=="")
{
alert("Vui lòng nhập username");
document.form1.username.focus();
return false;
}
if(document.form1.password.value=="")
{
alert("Vui lòng nhập password");
document.form1.password.focus();
return false;
}
return true;

}
</script>

//Form dang nhap
<form method="POST" name ="form1" action="xulydnhap.php" OnSubmit="return checkinput()">
<p align="left">
<font color="#FF3300"><b>
</font>Username:<font color="#FF3300"> </font> </b></p>
<p align="left">
<input type="text" name="username" size="24"></p>
<p align="left"><b>
Password:<font color="#FF3300">
</font></b></p>
<p align="left">
<input type="password" name="password" size="26"></p>
<p align="left">
<input type="submit" value="Submit" name="Submit">
<input type="reset" value="Reset" name="Reset"></p>

//Giao dien xoa va load du lieu len o xoa
//cho phep hien csdl len form:
<script type="text/javascript">
function kiemtra(MASV,TENSV,NGSINH,NOISINH,DIACHI,phai)
{
//alert("chuan bi vao");
document.form1.MASV.value=MASV;
//document.form1.username.disabled=1;
document.form1.TENSV.value=TENSV;
document.form1.NGSINH.value=NGSINH;
document.form1.NOISINH.value=NOISINH;
document.form1.DIACHI.value=DIACHI;
document.form1.phai.value=phai;
}
</script>
<form method="POST" name="form1" action="xlyxoa.php">
<p align="left"><b>MASV: </b>
<input type="text" name="MASV" size="44"></p>
<p align="left"><b>Họ và Tên:</b>
<input name="TENSV" size="44"></p>
<p align="left"><b>Ngày sinh:</b>
<input type="text" name="NGSINH" size="44"></p>
<p align="left"><b>Nơi sinh: </b>
<input type="text" name="NOISINH" size="44"></p>
<p align="left"><b>Địa chỉ:</b>
<input type="text" name="DIACHI" size="44"></p>
<p align="left"><b>
<input type="radio" value="Nam" checked name="phai">Nam
<input type="radio" name="phai" value="Nữ">Nữ</b></p>
<p align="left">
<input type="submit" value="Xóa" name="B1">
<input type="reset" value="Reset" name="B2"></p>
</form>
<!--load du lieu len-->
<center>
<?
require("ketnoi.php");
$sql="select * from SV";
$kq=mysql_query($sql,$lk);
if(mysql_num_rows($kq)>0)
{
echo"<table border=1><tr><td>MASV</td>";
echo"<td>TENSV</td>";
echo"<td>NGSINH</td>";
echo"<td>NSINH</td>";
echo"<td>DIACHI</td>";
echo"<td>PHÁI</td>";
echo"<td>XÓA</td></tr>";
while($dong=mysql_fetch_array($kq))
{
$MASV=$dong["MASV"];
$TENSV=$dong["TENSV"];
$NGSINH=$dong["NGSINH"];
$NOISINH=$dong["NOISINH"];
$DIACHI=$dong["DIACHI"];
$phai=$dong["GIOITINH"];
echo"<tr><td>$MASV</td>";
echo"<td>$TENSV</td>";
echo"<td>$NGSINH</td>";
echo"<td>$NOISINH</td>";
echo"<td>$DIACHI</td>";
echo"<td>$phai</td>";
echo"<td><Input type=radio name=xoa onclick=kiemtra('$MASV','$TENSV','$NGSINH','$NOISINH','$DIACHI','$phai')></td></tr>";

}
echo"</table>";

}
?>
</center>

//Giao dien tim va load truong len
<form method="POST" action="tim.php">
<p align="left"><font color="#FF0000"><b>MSSV:</b></font>
<input type="text" name="MASV" size="41"></p>
<p align="left">
<input type="submit" value="Tìm" name="B1">
<input type="reset" value="Reset" name="B2"></p>
</form>
<!--load du lieu len-->
<center>
<?
require("ketnoi.php");
$MASV=$_POST["MASV"];
$sql="select * from SV Where MASV='$MASV'";
$kq=mysql_query($sql,$lk);
{
echo"<table border=1><tr><td>MASV</td>";
echo"<td>TENSV</td>";
echo"<td>NGSINH</td>";
echo"<td>NSINH</td>";
echo"<td>DIACHI</td>";
echo"<td>PHÁI</td>";
While($dong=mysql_fetch_array($kq))
{
$MASV=$dong["MASV"];
$TENSV=$dong["TENSV"];
$NGSINH=$dong["NGSINH"];
$NOISINH=$dong["NOISINH"];
$DIACHI=$dong["DIACHI"];
$phai=$dong["GIOITINH"];
echo"<tr><td>$MASV</td>";
echo"<td>$TENSV</td>";
echo"<td>$NGSINH</td>";
echo"<td>$NOISINH</td>";
echo"<td>$DIACHI</td>";
echo"<td>$phai</td></tr>";
}
echo"</table>";
}
?>
</center>

//Giao dien sua
<script type="text/javascript">
function kiemtra(MASV,TENSV,NGSINH,NOISINH,DIACHI,phai)
{
//alert("chuan bi vao");
document.form1.MASV.value=MASV;
//document.form1.username.disabled=1;
document.form1.TENSV.value=TENSV;
document.form1.NGSINH.value=NGSINH;
document.form1.NOISINH.value=NOISINH;
document.form1.DIACHI.value=DIACHI;
document.form1.phai.value=phai;
}
</script>
<form method="POST" name="form1" action="xulysua.php">
<p align="left"><b>MASV:</b>
<input type="text" name="MASV" size="42"></p>
<p align="left"><b>Họ và Tên:</b>
<input name="TENSV" size="42"></p>
<p align="left"><b>Ngày sinh</b>
<input type="text" name="NGSINH" size="42"></p>
<p align="left"><b>Nơi sinh:</b>
<input type="text" name="NOISINH" size="42"></p>
<p align="left"><b>Địa chỉ:</b>
<input type="text" name="DIACHI" size="42"></p>
<p align="left"><b>Giới tính:
<input type="radio" value="Nam" checked name="phai">Nam
<input type="radio" name="phai" value="Nữ">Nữ</b></p>
<p align="left">
<input type="submit" value="Sửa" name="B1">
<input type="reset" value="Reset" name="B2"></p>
</form>
<!--load du lieu len-->
<center>
<?
require("ketnoi.php");
$sql="select * from SV";
$kq=mysql_query($sql,$lk);
if(mysql_num_rows($kq)>0)
{
echo"<table border=1><tr><td>MASV</td>";
echo"<td>TENSV</td>";
echo"<td>NGSINH</td>";
echo"<td>NSINH</td>";
echo"<td>DIACHI</td>";
echo"<td>PHÁI</td>";
echo"<td>SỮA</td></tr>";
while($dong=mysql_fetch_array($kq))
{
$MASV=$dong["MASV"];
$TENSV=$dong["TENSV"];
$NGSINH=$dong["NGSINH"];
$NOISINH=$dong["NOISINH"];
$DIACHI=$dong["DIACHI"];
$phai=$dong["GIOITINH"];
echo"<tr><td>$MASV</td>";
echo"<td>$TENSV</td>";
echo"<td>$NGSINH</td>";
echo"<td>$NOISINH</td>";
echo"<td>$DIACHI</td>";
echo"<td>$phai</td>";
echo"<td><Input type=radio name=sua onclick=kiemtra('$MASV','$TENSV','$NGSINH','$NOISINH','$DIACHI','$phai')></td></tr>";

}
echo"</table>";

}
?>
</center>

//Xu ly tim
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Xu ly tim</title>
</head>

<body>
<?
require("ketnoi.php");
require("Trang giao dien tim.php");
$MASV=$_POST["MASV"];
$sql="select*from SV where MASV='$MASV'";
$kq=mysql_query($sql,$lk);
if(mysql_num_rows($kq)>0)
{
?>
<script>
alert("Đã tìm thấy <?echo("$MASV")?>");
</script>
<?
}
else
{
?>
<script>
alert("Sorry...Khong tim thay <?echo("$MASV")?>");
</script>
<?
}
?>
</body>
</html>

//Them sinh vien
<html>
<?
require("ketnoi.php");
$MASV=$_POST["MASV"];
$TENSV=$_POST["TENSV"];
$NGSINH=$_POST["NGSINH"];
$NOISINH=$_POST["NOISINH"];
$DIACHI=$_POST["DIACHI"];
$phai=$_POST["Phai"];
$sql="select*from SV Where MASV='$MASV'";
$kq=mysql_query($sql,$lk);
If(mysql_num_rows($kq)>0)
{
require("Dang ki1.php");
?>
<script>
alert("<?echo("$MASV")?> Đã bị trùng, Vui lòng thêm lại...Thanks...");
</script>
<?
}
else
{
$sql="insert into SV(MASV,TENSV,NGSINH,NOISINH,DIACHI,GIOITINH)value('$MASV','$TENSV','$NGSINH','$NOISINH',
'$DIACHI','$phai')";
$kq=mysql_query($sql,$lk);
require("Dang ki1.php");
?>
<script>
alert("Bạn đã thêm thành công!");
</script>
<?
}
?>
</html>

//Ket noi:
<?php
$lk=mysql_connect("localhost","root","")or die("Connect unsucessful. Sorry...");
mysql_select_db("QLSV",$lk);
?>

//Hien thi:
<?php
require("ketnoi.php");
$sql="select*from USER";
$kq=mysql_query($sql,$lk);
if(mysql_num_rows($kq)>0)
{
echo"<table border=1><tr>";
echo"<td>username</td>";
echo"<td>password</td>";
echo"<td>email</td>";
echo"<td>diachi</td>";
echo"<td>phai</td>";
while($tam=mysql_fetch_array($kq))
{
$m=$tam["username"];
$t=$tam["password"];
$s=$tam["email"];
$g=$tam["diachi"];
$h=$tam["phai"];
echo"<tr><td>$m</td>";
echo"<td>$t</td>";
echo"<td>$s</td>";
echo"<td>$g</td>";
echo"<td>$h</td>";
}
echo"</table>";
}
?>

//Giao dien dang ki
<!--Kiem tra co nhap vo hay chua-->
<script type="text/Javascript">
function checkinput()
{
if(document.form1.user.value=="")
{
alert("Vui lòng nhập username");
document.form1.user.focus();
return false;
}
if(document.form1.pass.value=="")
{
alert("Vui lòng nhập password");
document.form1.pass.focus();
return false;
}
if(document.form1.email.value=="")
{
alert("Vui lòng nhập password");
document.form1.email.focus();
return false;
}
if(document.form1.diachi.value=="")
{
alert("Vui lòng nhập password");
document.form1.diachi.focus();
return false;
}
return true;
}
</script><!--Kiem tra co nhap vo hay chua-->
<form method="POST" name ="form1" action="xulydk.php" OnSubmit="return checkinput()">
<p align="left"><b>Username:</b>
<input type="text" name="user" size="42"></p>
<p align="left"><b>Password:</b>
<input type="password" name="pass" size="43"></p>
<p align="left"><b>Email:</b>
<input type="text" name="email" size="42"></p>
<p align="left"><b>Địa chỉ:</b>
<input type="text" name="diachi" size="42"></p>
<p align="left"><b>Giới tính:</b>
<input type="radio" value="Nam" checked name="Phai"> Nam
<input type="radio" name="Phai" value="Nữ"> Nữ</p>
<p align="left">
<input type="submit" value="Đăng Kí" name="Submit">
<input type="reset" value="Reset" name="B2"></p>
</form>

//Dang nhập
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Đăng nhập</title>
</head>

<body>

<p><b>Đăng nhập</b></p>
<form method="POST" action="dangnhap.php">
<p>Ten người dùng:<input type="text" name="T1" size="20"></p>
<p>Mật khẩu:<input type="text" name="T2" size="20"></p>
<p><input type="checkbox" name="C1" value="ON">Lưu thông tin</p>
<p><b>Ngay sinh:</b></p>
<p>Ngày:<select size="1" name="D1">
<option value="0" selected>0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>Tháng:<select size="1" name="D2">
<option value="0" selected>0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option>11</option>
<option>12</option>
</select>Năm:<select size="1" name="D3">
<option value="1980" selected>1980</option>
<option value="1981">1981</option>
<option value="1982">1982</option>
<option value="1983">1983</option>
<option value="1984">1984</option>
<option value="1985">1985</option>
<option value="1986">1986</option>
<option value="1987">1987</option>
<option value="1988">1988</option>
<option value="1991">1991</option>
<option value="1989">1989</option>
<option value="1990">1990</option>
</select></p>
<p><input type="submit" value="Đăng nhập" name="B1"><input type="reset" value="Reset" name="B2"></p>
<p><a href="quen_mk.php">Bạn quên mật khẩu</a></p>
<p>Bạn chưa có tài khoản? <a href="tao_mk.php">Tạo một tài khoảng mới.</a></p>
</form>
<p>&nbsp;</p>

</body>

</html>

//GIAI ĐỀ THI K6
Câu 1: thiết kế giao diện
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Dang ky</title>
</head>

<body>

<p><b>Nhập thông tin đăng ký</b></p>
<form method="POST" action="Dangky.php">
<p>Tên đăng nhập:<input type="text" name="T1" size="20">(*)</p>
<p>Mật khẩu:<input type="password" name="T2" size="20">(*)</p>
<p>Xác nhận mật khẩu:<input type="text" name="T3" size="20">(*)</p>
<p>Giới tính:<input type="radio" value="V1" checked name="R1">Nam<input type="radio" name="R1" value="V2">Nữ</p>
<p>Email:<input type="text" name="T5" size="20">(*)</p>
<p>Nghề nghiệp:<select size="1" name="D1">
<option value="Khác" selected>Khác</option>
<option value="Giáo Viên">Giáo Viên</option>
<option value="Học Sinh">Học Sinh</option>
<option value="Sinh Viên">Sinh Viên</option>
<option value="Kỷ Sư">Kỷ Sư</option>
</select></p>
<p>Thông tin thêm:</p>
<p><textarea rows="5" name="S1" cols="20"></textarea></p>
<p><input type="submit" value="Đăng ký" name="B1"><input type="reset" value="Hủy bỏ" name="B2"></p>
</form>
<p>&nbsp;</p>

</body>

</html>

//THEM MOI SACH (Đề lần 1)
1.Giao dien:
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Thêm mới</title>
</head>

<body>

<p><b>Nhập thông tin sách mới</b></p>
<!--Kiem tra co nhap vo hay chua-->
<script type="text/Javascript">
function checkinput()
{
if(document.form1.MASACH.value=="")
{
alert("Vui lòng nhập MASACH");
document.form1.MASACH.focus();
return false;
}
if(document.form1.TENSACH.value=="")
{
alert("Vui lòng nhập TENSACH");
document.form1.TENSACH.focus();
return false;
}
if(document.form1.NXB.value=="")
{
alert("Vui lòng nhập NXB");
document.form1.NXB.focus();
return false;
}
if(document.form1.TACGIA.value=="")
{
alert("Vui lòng nhập TACGIA");
document.form1.TACGIA.focus();
return false;
}
if(document.form1.SOTRANG.value=="")
{
alert("Vui lòng nhập SOTRANG");
document.form1.SOTRANG.focus();
return false;
}
return true;
}
</script><!--Kiem tra co nhap vo hay chua-->
<form method="POST" name ="form1" action="xulythemmoi.php" OnSubmit="return checkinput()">
<p>Mã sách:<input type="text" name="MASACH" size="20">(*)</p>
<p>Tên sách:<input type="text" name="TENSACH" size="20">(*)</p>
<p>Nhà xuất bản:<select size="1" name="NXB">
<option value="Kim Ðồng" selected>Kim Đồng</option>
<option value="Đồng Nai">Đồng Nai</option>
<option value="Hà Nội">Hà Nội</option>
</select></p>
<p>Tác giả:<select size="1" name="TACGIA">
<option selected value="Nguyễn Bỉnh Khiêm">Nguyễn Bỉnh Khiêm</option>
<option value="Nguyễn Du">Nguyễn Du</option>
<option value="Hồ Xuân Hương">Hồ Xuân Hương</option>
<option value="Ngô Tất Tố">Ngô Tất Tố</option>
</select></p>
<p>Số trang:<input type="text" name="SOTRANG" size="20">(*)(Phải là số)</p>
<p><input type="submit" value="Thêm mới" name="B1"><input type="reset" value="Hủy bỏ" name="B2"></p>
</form>
<?
require("hienthi.php");
?>
</body>

</html>

2.Code xuly them moi sach: (php)
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>New Page 3</title>
</head>

<body>
<html>
<?
require("ketnoi.php");
require("bai2.php");
$MASACH=$_POST["MASACH"];
$TENSACH=$_POST["TENSACH"];
$NXB=$_POST["NXB"];
$TACGIA=$_POST["TACGIA"];
$SOTRANG=$_POST["SOTRANG"];
$sql="select*from SACH Where MASACH='$MASACH'";
$kq=mysql_query($sql,$lk);
if(mysql_num_rows($kq)>0)
{
?>
<script>
alert("<?echo("$MASACH")?> Đã bị trùng, Vui lòng thêm lại...Thanks...");
</script>
<?
}
else
{
$sql="insert into SACH(MASACH,TENSACH,NXB,TACGIA,SOTRANG)value('$MASACH','$TENSACH','$NXB','$TACGIA','$SOTRANG')";
$kq=mysql_query($sql,$lk);
?>
<script>
alert("Ban da them thanh cong!");
</script>
<?
}
?>
</html>

</body>

</html>

3.Hien thi
<?php
require("ketnoi.php");
$sql="select*from SACH";
$kq=mysql_query($sql,$lk);
if(mysql_num_rows($kq)>0)
{
echo"<table border=1><tr>";
echo"<td>MASACH</td>";
echo"<td>TENSACH</td>";
echo"<td>NXB</td>";
echo"<td>TACGIA</td>";
echo"<td>SOTRANG</td>";
while($tam=mysql_fetch_array($kq))
{
$m=$tam["MASACH"];
$t=$tam["TENSACH"];
$s=$tam["NXB"];
$g=$tam["TACGIA"];
$h=$tam["SOTRANG"];
echo"<tr><td>$m</td>";
echo"<td>$t</td>";
echo"<td>$s</td>";
echo"<td>$g</td>";
echo"<td>$h</td>";
}
echo"</table>";
}
?>

//Tìm sách:
1.giao dien tim sach:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Giao dien tim sach</title>
</head>
<body>
<p><b>Giao dien tim sach</b></p>
<!--Kiem tra co nhap vo hay chua-->
<script type="text/Javascript">
function checkinput()
{
if(document.form1.NXB.value=="")
{
alert("Vui lòng nhập NXB”);
document.form1.NXB.focus();
return false;
}
return true;
}
</script><!--Kiem tra co nhap vo hay chua-->
<form method="POST" name ="form1" action="timsach.php" OnSubmit="return checkinput()">
<p>Nhà xuất bản:<select size="1" name="NXB">
<option value="Lâm Đồng">Lâm Đồng</option>
<option selected value="Hà Nội">Hà Nội</option>
<option value="Thanh Niên">Thanh Niên</option>
</select></p>
<p><input type="submit" value="Tìm" name="B1"><input type="reset" value="Hủy bỏ" name="B2"></p>
</form>
<?php
require("ketnoi.php");
$NXB=$_POST["NXB"];
$sql="select*from SACH where NXB='$NXB'";
$kq=mysql_query($sql,$lk);
{
echo"<table border=1><tr>";
echo"<td>MASACH</td>";
echo"<td>TENSACH</td>";
echo"<td>NXB</td>";
echo"<td>TACGIA</td>";
echo"<td>SOTRANG</td>";
while($tam=mysql_fetch_array($kq))
{
$m=$tam["MASACH"];
$t=$tam["TENSACH"];
$s=$tam["NXB"];
$g=$tam["TACGIA"];
$h=$tam["SOTRANG"];
echo"<tr><td>$m</td>";
echo"<td>$t</td>";
echo"<td>$s</td>";
echo"<td>$g</td>";
echo"<td>$h</td>";
}
echo"</table>";
}
?>
</body>
</html>
2.xu ly timsach.php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>New Page 1</title>
</head>
<body>
<?
require("ketnoi.php");
require("giao dien tim.php");
$NXB=$_POST["NXB"];
$sql="select*from SACH where NXB='$NXB'";
$kq=mysql_query($sql,$lk);
if(mysql_num_rows($kq)>0)
{
?>
<script>
alert("Đã tìm thấy <?echo("$NXB")?>");
</script>
<?
}
else
{
?>
<script>
alert("Sorry...Khong tim thay <?echo("$NXB")?>");
</script>
<?
}
?>

</body>

</html>
//ĐỀ LẦN I:
Câu 1: viet trang index.html
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Giới thiệu</title>
</head>
<body>
<table border="1" width="95%" id="table1" height="347">
<tr><--!tieu de-->
<td colspan="3" height="50">
<img border="0" src="tieude.png" width="715" height="86"></td>
</tr>
<tr>
<td valign="top" width="15%"><--!ben trai-->
<a href="Gioithieu.html">Giới thiệu</a><p>
<a href="Dangky.php">Đăng ký</a></p>
<p><a href="Hoidap.php">Hỏi đáp</a></p>
<p><a href="Thanhvien.php">Thành viên</a></p>
<p><a href="Baitrongngay.php">Bài trong ngày</a></p>
<p><a href="Timkiem.php">Tìm kiếm</a></td>
<td width="62%" valign="top"><--!chinh giua-->
<p>DIỄN ĐÀN VIỆT NAM</p>
<p>Website: </p>
</td>
<--!hinh ben phai-->
<td width="20%" valign="top">
<img border="0" src="hinh1.png" width="144" height="92"><br><br>
<img border="0" src="hinh2.png" width="144" height="92">
</td>
</tr>
<--!duoi cung-->
<tr>
<td colspan="3" height="74">
<p align="center">
<a href="Lienlac.html">Liên Lạc</a>
<a href="diendan.html">Diễn Đàn Việt Nam</a>
<a href="Luutru.html">Lưu Trữ</a>
<a href="trolen.html">Trở Lên Trên</a>
</td>
</tr>
</table>
</body>
</html>


Report this post
Top
 Profile E-mail  
Reply with quote  
 Post subject: Re: Tai lieu tham khao thi cuoi hoc ky
PostPosted: Tue Jun 02, 2009 9:51 pm 
Offline

Joined: Thu Feb 05, 2009 1:48 pm
Posts: 21
Cám ơn nha !


Report this post
Top
 Profile E-mail  
Reply with quote  
 Post subject: Re: Tai lieu tham khao thi cuoi hoc ky
PostPosted: Tue Jun 02, 2009 10:53 pm 
Offline

Joined: Mon Feb 16, 2009 9:47 am
Posts: 12
---------
thank ban nha


Report this post
Top
 Profile E-mail  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Make Forum · php-BB© · Internationalization Project · Report abuse · Terms Of Use/Privacy Policy
© Forums-Free.com 2009