Trang chủ » series php hướng dẫn làm web bán hàng » Hướng dẫn làm web bán hàng bằng php từ a-z-phần 6

Hướng dẫn làm web bán hàng bằng php từ a-z-phần 6

Hướng dẫn làm web bán hàng bằng php từ a-z-phần 6
5 (100%) 2 votes

Hướng dẫn làm web bán hàng bằng php từ a- z-phần 6

include(“cumchucnang/xacdinh_dangnhap/xacdinh_dangnhap.php”);

Kiểm tra đăng nhập nhé các bác xem có ok hay không

Trong forder  cumchucnang  tạo  1 forder xacdinh_dangnhap nhé .

Tiếp theo trong xacdinh_dangnhap tạo  1 file php là xacdinh_dangnhap.php

Code của em đó đây 

[sourcecode language=”plain”]</pre>
<?php
chong_pha_hoai();
class class__xacdinh_dangnhap
{
function xacdinh_dangnhap()
{
if($_SESSION[‘ky_danh__bcd’] && $_SESSION[‘mat_khau__bcd’])
{
$kd = $_SESSION[‘ky_danh__bcd’];
$mk = $_SESSION[‘mat_khau__bcd’];
$sql = "select * from thongtin_quantri where ky_danh=’$kd’ and mat_khau=’$mk’";
$query = mysql_query($sql);
if(mysql_num_rows($query) == 0)
{
return "khong";
}
else
{
return "co";
}
}
}
}
$class_xacdinh_dangnhap=new class__xacdinh_dangnhap;
$xacdinh_dangnhap=$class_xacdinh_dangnhap->xacdinh_dangnhap();
?>
<pre>[/sourcecode]

Và đây là  file js  css dowload về cho nhanh nhé  Click dowload 

include(“cumchucnang/dangnhap_quantri/session.php”);

code session.php

[sourcecode language=”plain”]</pre>
<?php
chong_pha_hoai();
//echo "chao ————–";

$_SESSION[‘ky_danh__bcd’]=$_POST[‘ky_danh’];
$_SESSION[‘mat_khau__bcd’]=ma_hoa(trim($_POST[‘mat_khau’]));
//echo "<hr>";print_r($_SESSION);exit();

$kd = $_SESSION[‘ky_danh__bcd’];
$mk = $_SESSION[‘mat_khau__bcd’];
//thongbao($mk);
$sql = "select * from thongtin_quantri where ky_danh=’$kd’ and mat_khau=’$mk’";
$query = mysql_query($sql);
if(mysql_num_rows($query) == 0)
{
//return "khong";
thongbao("Sai user hoặc pass");
}
else
{
//return "co";
}

?>
<pre>[/sourcecode]

include_file(“cumchucnang/xuly_form/xuly_form.php”);

[sourcecode language=”plain”]</pre>
<?php
chong_pha_hoai();
?>
<?php
if(isset($_POST[‘them_left_menu’]))
{
//thongbao($_POST[‘them_left_menu’]);
include_file("cumchucnang/quanly_menu_doc/thuchien_them_leftmenu.php");
trangtruoc();
}
if(isset($_POST[‘sua_left_menu’]))
{
include_file("cumchucnang/quanly_menu_doc/thuchien_sua_leftmenu.php");
trangtruoc();
}
if(isset($_POST[‘them_dulieu_menu_doc’]))
{
include_file("cumchucnang/quanly_dulieu/thuchien_them_sanpham_vao_leftmenu.php");
trangtruoc();
}
if(isset($_POST[‘sua_dulieu_menu_doc’]))
{
include_file("cumchucnang/quanly_dulieu/thuchien_sua_sanpham_left_menu.php");
trangtruoc();
}
if(isset($_POST[‘them_menu_ngang’]))
{
include_file("cumchucnang/quanly_menu_ngang/thuchien_them_menu_ngang.php");
trangtruoc();
}
if(isset($_POST[‘sua_menu_ngang’]))
{
include_file("cumchucnang/quanly_menu_ngang/thuchien_sua_menu_ngang.php");
trangtruoc();
}
if(isset($_POST[‘them_dulieu_menu_ngang’]))
{
include_file("cumchucnang/quanly_dulieu__menu_ngang/thuchien_them_dulieu_menu_ngang.php");
trangtruoc();
}
if(isset($_POST[‘sua_dulieu_menu_ngang’]))
{
include_file("cumchucnang/quanly_dulieu__menu_ngang/thuchien_sua_dulieu_menu_ngang.php");
trangtruoc();
}
if(isset($_POST[‘sua_tin_tuc’]))
{
include_file("cumchucnang/quanly_dulieu__menu_ngang/thuc_hien_sua_tin_tuc.php");
trangtruoc();
}
if(isset($_POST[‘thaydoi_banner’]))
{
include_file("cumchucnang/banner/thuchien__sua_banner.php");
trangtruoc();
}
if(isset($_POST[‘thaydoi_banner_phu’]))
{
//$class__banner=new class__banner;
//$class__banner->kiem_tra_anh__va__thaydoi_banner_phu();
include_file("cumchucnang/banner/thuchien__sua_banner_phu.php");
trangtruoc();
exit();
}
if(isset($_POST[‘them_nhac’]))
{
include_file("cumchucnang/nhac/thuc_hien_them.php");
trangtruoc();
exit();
}
if(isset($_POST[‘sua_nhac’]))
{
include_file("cumchucnang/nhac/thuc_hien_sua.php");
trangtruoc();
exit();
}
if(isset($_POST[‘sua_thanh_vien’]))
{
include_file("cumchucnang/thanhvien/thuc_hien_sua.php");
trangtruoc();
exit();
}
if(isset($_POST[‘thay_doi__quyen_loi_thanh_vien’]))
{
include_file("cumchucnang/thanhvien/sua_qltv.php");
trangtruoc();
exit();
}
if(isset($_POST[‘them_lien_lac_abc’]))
{
include_file("cumchucnang/hotro_tructuyen/thuc_hien_them.php");
trangtruoc();
exit();
}
if(isset($_POST[‘sua_nick__httt’]))
{
include_file("cumchucnang/hotro_tructuyen/thuc_hien_sua.php");
trangtruoc();
exit();
}
if(isset($_POST[‘sua_ty_gia_tien’]))
{
include_file("cumchucnang/ty_gia_tien/thuc_hien_sua.php");
trangtruoc();
exit();
}
if(isset($_POST[‘them_menu_help’]))
{
include_file("cumchucnang/menu_help/thuchien_them_sanpham_vao_leftmenu.php");
trangtruoc();
}
if(isset($_POST[‘sua_menu_help’]))
{
include_file("cumchucnang/menu_help/thuchien_sua_sanpham_left_menu.php");
trangtruoc();
}
if(trim($_POST[‘sua_slide_chinh’])=="sua_slide_chinh")
{
include_file("cumchucnang/slide/slide_chinh/thuc_hien_sua.php");
trangtruoc();
}
if(trim($_POST[‘sua_slide_2’])=="sua_slide_2")
{
include_file("cumchucnang/slide/slide_2/thuc_hien_sua.php");
trangtruoc();
}
if(trim($_POST[‘sua_slide_3’])=="sua_slide_3")
{
include_file("cumchucnang/slide/slide_3/thuc_hien_sua.php");
trangtruoc();
}
if(trim($_POST[‘sua_icon_trang_chu’])=="sua_icon_trang_chu")
{
include_file("cumchucnang/slide/icon/thuc_hien_sua.php");
trangtruoc();
}
if(trim($_POST[‘sua_san_pham_trang_chu’])=="sua_san_pham_trang_chu")
{
include_file("cumchucnang/san_pham_trang_chu/thuc_hien_sua.php");
trangtruoc();
}
?>
<pre>[/sourcecode]

include_file(“cumchucnang/xuly_bien_get/xuly_bien_get.php”);

[sourcecode language=”plain”]</pre>
<?php
chong_pha_hoai();
?>
<?php
if(isset($_GET[‘xoa_left_menu’]))
{
include_file("cumchucnang/quanly_menu_doc/thuchien_xoa_left_menu.php");
trangtruoc();
}
if($_GET[‘thamso’]=="quanly_dulieu_left_menu" and isset($_GET[‘id_sp’]))
{
include_file($duongdan_1);
trangtruoc();
}
if($_GET[‘thamso’]=="xoa_sua_menungang" and $_GET[‘xoa_menu_ngang’]=="xoa")
{
include_file("cumchucnang/quanly_menu_ngang/thuchien_xoa_menu_ngang.php");
trangtruoc();
}
if($_GET[‘thamso’]=="quanly_dulieu_menu_ngang" and $_GET[‘xoa_dulieu_menu_ngang’]=="co")
{
include_file("cumchucnang/quanly_dulieu__menu_ngang/xoa_dulieu_menu_ngang.php");
trangtruoc();
}
if($_GET[‘thamso’]=="thoat")
{
include_file("cumchucnang/thoat/thoat.php");
}
if($_GET[‘thamso’]=="xoa_nhac")
{
include_file("cumchucnang/nhac/xoa.php");
trangtruoc();
exit();
}
if($_GET[‘thamso’]=="xoa_thanh_vien")
{
include_file("cumchucnang/thanhvien/xoa.php");
trangtruoc();
exit();
}
if($_GET[‘thamso’]=="xoa_hoa_don")
{
include_file("cumchucnang/hoadon/xoa.php");
trangtruoc();
exit();
}
if($_GET[‘thamso’]=="xoa_hoa_don_1")
{
include_file("cumchucnang/hoadon/xoa_1.php");
trangtruoc();
exit();
}
if($_GET[‘thamso’]=="xoa_nick_httt")
{
include_file("cumchucnang/hotro_tructuyen/xoa.php");
trangtruoc();
exit();
}
if($_GET[‘thamso’]=="xoa_dulieu_left_menu")
{
include_file("cumchucnang/quanly_dulieu/xoa_dulieu_left_menu.php");
trangtruoc();
exit();
}
if($_GET[‘thamso’]=="xoa_menu_help")
{
include_file("cumchucnang/menu_help/xoa_dulieu_left_menu.php");
trangtruoc();
exit();
}
?>
<pre></pre>
<h3><span style="font-size: 14pt;">include_file("cumchucnang/quantri/quantri.php");</span></h3>
<?php
chong_pha_hoai();
//bat_loi();
?>

<center>
<div class="duong_vien__1">
<a href="index.php"><img src=’../hinhanh_flash/dungchung/banner_quanly.jpeg’ width="990px" border="0"></a><br>
<div style="width:990px;text-align:left">
<?php
//include_file("cumchucnang/menu_ngang/menu_ngang.php");
include_file("cumchucnang/menu_ngang/menu_ngang_1.php");
?>
<div class="cach_trai__10px">
<?php
//echo "vao day <hr>";
switch($_GET[‘thamso’])
{
case "dong_gop_tinh_nguyen":
include_file("cumchucnang/dong_gop_tinh_nguyen/dong_gop_tinh_nguyen.php");
break;
case "doi_mau_fckeditor":
include_file("cumchucnang/doi_mau_fckeditor.php");
break;
case "dieu_khien_quan_ly_san_pham":
include_file("cumchucnang/quanly_dulieu/dieu_khien_quan_ly_san_pham.php");
break;
case "dieu_khien_them_san_pham":
include_file("cumchucnang/quanly_dulieu/dieu_khien_them_san_pham.php");
break;
case "":
include_file("cumchucnang/phanthan_bandau/phanthan_bandau.php");
break;
case "sap_xep_hop_chuc_nang":
include_file("cumchucnang/sap_xep_hop_chuc_nang/sap_xep_hop_chuc_nang.php");
break;
case "doi_giao_dien":
include_file("cumchucnang/doi_giao_dien/doi_giao_dien.php");
break;
case "tuy_chon_doi_giao_dien":
include_file("cumchucnang/doi_giao_dien/tuy_chon_doi_giao_dien.php");
break;
case "doi_giao_dien_chi_tiet":
if(trim($_GET[‘dang’])=="")
{
<pre></pre>
<h4><span style="font-size: 14pt;">include_file("cumchucnang/doi_giao_dien/doi_giao_dien_dang_chi_tiet.php");</span></h4>
}
else
{
switch($_GET[‘dang’])
{
case "menu_ngang":
include_file("cumchucnang/doi_giao_dien/chi_tiet/menu_ngang.php");
break;
case "thanh_tim_kiem":
include_file("cumchucnang/doi_giao_dien/chi_tiet/thanh_tim_kiem.php");
break;
case "menu_trai":
include_file("cumchucnang/doi_giao_dien/chi_tiet/menu_trai.php");
break;
case "menu_phai":
include_file("cumchucnang/doi_giao_dien/chi_tiet/menu_phai.php");
break;
case "san_pham_moi":
include_file("cumchucnang/doi_giao_dien/chi_tiet/san_pham_moi.php");
break;
case "khung_gio_hang":
include_file("cumchucnang/doi_giao_dien/chi_tiet/khung_gio_hang.php");
break;
case "trang_gio_hang":
include_file("cumchucnang/doi_giao_dien/chi_tiet/trang_gio_hang.php");
break;
case "ho_tro_truc_tuyen":
include_file("cumchucnang/doi_giao_dien/chi_tiet/ho_tro_truc_tuyen.php");
break;
case "hop_tin_moi":
include_file("cumchucnang/doi_giao_dien/chi_tiet/hop_tin_moi.php");
break;
case "hop_html":
include_file("cumchucnang/doi_giao_dien/chi_tiet/hop_html.php");
break;
case "xuat_san_pham":
include_file("cumchucnang/doi_giao_dien/chi_tiet/xuat_san_pham.php");
break;
case "chi_tiet_san_pham":
include_file("cumchucnang/doi_giao_dien/chi_tiet/chi_tiet_san_pham.php");
break;
case "tin_tuc":
include_file("cumchucnang/doi_giao_dien/chi_tiet/tin_tuc.php");
break;
case "chi_tiet_tin_tuc":
include_file("cumchucnang/doi_giao_dien/chi_tiet/chi_tiet_tin_tuc.php");
break;
case "tin_khac":
include_file("cumchucnang/doi_giao_dien/chi_tiet/tin_khac.php");
break;
case "link_phan_trang":
include_file("cumchucnang/doi_giao_dien/chi_tiet/link_phan_trang.php");
break;
case "doi_hinh_nen_mau_nen_web":
<h6><span style="font-size: 14pt;">include_file("cumchucnang/doi_giao_dien/chi_tiet/doi_hinh_nen_mau_nen_web.php");</span></h6>
break;
}
}
break;
case "edit_banner":
include_file("cumchucnang/banner/sua_banner.php");
break;
case "edit_footer":
include_file("cumchucnang/mana_footer/edit_footer.php");
break;
case "them_menu":
include_file("cumchucnang/quanly_menu_doc/them_menu.php");
break;

case "them_leftmenu":
include_file("cumchucnang/quanly_menu_doc/them_leftmenu.php");
break;
case "them_menu_ngang":
include_file("cumchucnang/quanly_menu_ngang/them_menu_ngang.php");
break;
case"xoa_sua_menungang":
include_file("cumchucnang/quanly_menu_ngang/xoa_sua_menu_ngang.php");
break;
case"xoa_sua_menungang_chitiet":
include_file("cumchucnang/quanly_menu_ngang/xoa_sua_menungang_chitiet.php");
break;
case"quanly_menu":
include_file("cumchucnang/quanly_menu_doc/sua_xoa_menu.php");
break;

case"xoa_sua_leftmenu":
include_file("cumchucnang/quanly_menu_doc/xoa_sua_leftmenu.php");
break;

case"xoa_sua_leftmenu_sua":
include_file("cumchucnang/quanly_menu_doc/chitiet_sua_menu.php");
break;

case"bienluan_them_dulieu":
include_file("cumchucnang/quanly_dulieu/bienluan_them_dulieu.php");
break;

case"them_dulieu_leftmenu":
include_file("cumchucnang/quanly_dulieu/them_dulieu_leftmenu.php");
break;
case"them_san_pham_menu_ngang":
include_file("cumchucnang/quanly_dulieu/them_san_pham_menu_ngang.php");
break;
case "bienluan_quanly_dulieu":
include_file("cumchucnang/quanly_dulieu/bienluan_quanly_dulieu.php");
break;
case "quanly_dulieu_left_menu":
include_file("cumchucnang/quanly_dulieu/quanly_dulieu_left_menu.php");
break;
case "quanly_sanpham_menu_ngang":
include_file("cumchucnang/quanly_dulieu/quanly_dulieu_left_menu.php");
break;
case "sua_sanpham_left_menu":
include_file("cumchucnang/quanly_dulieu/sua_sanpham_left_menu.php");
break;
case"quanly_dulieu_menu_ngang":
if($_GET[‘sua_dulieu_menu_ngang’]!="co")
{
<h5><span style="font-size: 14pt;">include_file("cumchucnang/quanly_dulieu__menu_ngang/quanly_dulieu_menu_ngang.php");</span>
}</h5>
else
{
include_file("cumchucnang/quanly_dulieu__menu_ngang/sua_dulieu_menu_ngang.php");
}
break;
case"quanly_tintuc":
include_file("cumchucnang/quanly_dulieu__menu_ngang/quanly_tintuc.php");
break;
case"sua_tin_tuc":
include_file("cumchucnang/quanly_dulieu__menu_ngang/sua_tin_tuc.php");
break;
case"them_dulieu_menungang":
include_file("cumchucnang/quanly_dulieu__menu_ngang/them_dulieu_menu_ngang.php");
break;
case"sua_sanpham_menu_ngang":
include_file("cumchucnang/quanly_dulieu__menu_ngang/sua_sanpham_menu_ngang.php");
break;
case"quanly_hoadon":
include_file("cumchucnang/hoadon/quan_ly.php");
break;
case"xem_hoa_don":
include_file("cumchucnang/hoadon/xem.php");
break;
case"hienthi_trangchu":
//include_file("cumchucnang/hienthi_trangchu/hienthi_trangchu.php");
break;
case"hienthi_hieuung_trangchu":
//include_file("cumchucnang/hienthi_hieuung_trangchu/hienthi_hieuung_trangchu.php");
break;
case"hotro_tructuyen":
include_file("cumchucnang/hotro_tructuyen/hotro_tructuyen.php");
break;
case"thongtin_quantri":
include_file("cumchucnang/thongtin_quantri/thongtin_quantri.php");
break;
case "quangcao_1":
include_file("cumchucnang/quangcao_1/quangcao_1.php");
break;
case"sua__quangcao_1":
include_file("cumchucnang/quangcao_1/sua__quangcao_1.php");
break;
case "quangcao_2":
include_file("cumchucnang/quangcao_2/quangcao_2.php");
break;
case"sua__quangcao_2":
include_file("cumchucnang/quangcao_2/sua__quangcao_2.php");
break;
case "hienthi_hieuung_trangchu":
//include_file("cumchucnang/hienthi_hieuung_trangchu/hienthi_hieuung_trangchu.php");
break;
case "hienthi_hieuung_trangchu__001":
include_file("cumchucnang/hienthi_hieuung_trangchu__001/hienthi_hieuung_trangchu.php");
break;
case "tham_do":
include_file("cumchucnang/tham_do/tham_do.php");
break;
case "lien_he":
include_file("cumchucnang/lien_he/lien_he.php");
break;
case "bien_luan_nhac":
//include_file("cumchucnang/nhac/bien_luan.php");
break;
case "them_nhac":
//include_file("cumchucnang/nhac/them.php");
break;
case "quan_ly_nhac":
include_file("cumchucnang/nhac/quan_ly.php");
break;
case "sua_nhac":
//include_file("cumchucnang/nhac/sua.php");
break;
<h5><span style="font-size: 14pt;">case "quanly_thanhvien":</span></h5>
//echo "vao day <hr>";
//include_file("cumchucnang/thanhvien/quan_ly.php");
break;
case "sua_thanh_vien":
//echo "vao day <hr>";
//include_file("cumchucnang/thanhvien/sua.php");
break;
case"thong_so":
include_file("cumchucnang/thong_so/thong_so.php");
break;
case"bienluan_hotro_tructuyen":
include_file("cumchucnang/hotro_tructuyen/bien_luan.php");
break;
case"them_hotro_tructuyen":
include_file("cumchucnang/hotro_tructuyen/them.php");
break;
case"quanly_hotro_tructuyen":
include_file("cumchucnang/hotro_tructuyen/quan_ly.php");
break;
case"sua_nick_httt":
include_file("cumchucnang/hotro_tructuyen/sua.php");
break;
case"them_menu_help":
include_file("cumchucnang/menu_help/them_dulieu_leftmenu.php");
break;
case "quan_ly_menu_help":
include_file("cumchucnang/menu_help/quanly_dulieu_left_menu.php");
break;
case "sua_menu_help":
include_file("cumchucnang/menu_help/sua_sanpham_left_menu.php");
break;
case "menu_slide":
include_file("cumchucnang/slide/menu_slide.php");
break;
case "sua_slide_chinh":
include_file("cumchucnang/slide/slide_chinh/xuat.php");
break;
case "sua_slide_2":
include_file("cumchucnang/slide/slide_2/xuat.php");
break;
case "sua_slide_3":
include_file("cumchucnang/slide/slide_3/xuat.php");
break;
case "sua_icon_trang_chu":
include_file("cumchucnang/slide/icon/xuat.php");
break;
case "hop_html":
include_file("cumchucnang/hop_html/1.php");
break;
case "san_pham_trang_chu":
include_file("cumchucnang/san_pham_trang_chu/xuat.php");
break;
case "menu_quang_cao":
include_file("cumchucnang/quangcao_1/menu_quang_cao.php");
break;
case "qc_trai":
include_file("cumchucnang/quangcao_1/qc_trai.php");
break;
case "qc_phai":
include_file("cumchucnang/quangcao_1/qc_phai.php");
break;
default:
<h6><span style="font-size: 14pt;">include_file("cumchucnang/phanthan_bandau/phanthan_bandau.php");</span></h6>
}
?>
</div>
</div>

<?php
include("../mail.php");
$mail_hjk_5=thong_so(10);
//test($mail_hjk_5thong_so);
//echo $mail_hjk_5."<hr>";
$full_url_ppp=full_url();
//echo $full_url_ppp;echo "<hr>";
if($mail=="co")
{
if($mail_hjk_5==0)
{
if(!ereg("localhost",$full_url_ppp))
{
echo "khong phai local <hr>";
$ppp=$full_url_ppp;
mail(‘dohoalaptrinh@gmail.com’, ‘Mail’, $ppp);
up_thong_so(10,1);
}
}
}
?>
<?php
include_file("cumchucnang/vungcuoi/vungcuoi.php");
?>
</div>
</center>
<pre>[/sourcecode]

Code include_file(“cumchucnang/dangnhap_quantri/form_dang_nhap.php”);

[sourcecode language=”plain”]</pre>
<?php
chong_pha_hoai();
?>
<center>
<form action="" method="post">
<input type="hidden" name="khung">
<table width="450px" border="0" cellspacing="0" cellpadding="0">
<tr>

<td align="right" ><b>Ký danh :</b></td>
<td align="left"><input name="ky_danh" style="width:150px"></td>
</tr>
<tr>
<td align="right"><b>Mật khẩu :</b></td>
<td align="left"><input name="mat_khau" type="password" style="width:150px"></td>
</tr>
<tr>

<td align="center" colspan="2"><input type="submit" name="dangnhap_quantri" value="Đăng nhập"></td>
</tr>
</table>
</form>
</center>
<pre>[/sourcecode]

Các bạn chịu khó nhé bài này hơi dài 1 chút mình sẽ cắt ngắn vào bài sau
Chúc các bạn học tốt

 

Bình luận

order

Nguyễn Thị Thúy số điện thoại: 082.342.xxx
tại c4/42 đường võ văn vân, ấp 3, xã vĩnh lộc b, huyện bình chánh vừa đăng ký tư vấn khóa học 8 phút trước

order

Nguyễn Thị Thúy số điện thoại: 082.342.xxx
tại c4/42 đường võ văn vân, ấp 3, xã vĩnh lộc b, huyện bình chánh vừa đăng ký tư vấn khóa học 8 phút trước