banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành Windows Hỏi cách bố trí code ở trang index (php)  XML
  [Question]   Hỏi cách bố trí code ở trang index (php) 06/04/2007 22:38:12 (+0700) | #1 | 52059
concocnho
Member

[Minus]    0    [Plus]
Joined: 24/03/2007 17:44:22
Messages: 21
Offline
[Profile] [PM]
xin đừng bảo em học cách của bọn phpbb,VB...em gà lắm .Cách của em hiện tại là cho hiển thị tất cả ở trang index tách phần html ra khỏi phần php hoàn toàn, dựa vào biến khai báo ở URL để hiển thị , dí dụ index.php?act=reg sẽ include file template register.html.Nhưng em thấy nẩy sinh nhiều vấn đề quá .ví dụ khi thành viên đăng nhập ....các anh có thể cho xin 1 đoạn code ở trang index do các anh làm được ko?
[Up] [Print Copy]
  [Question]   Re: Hỏi cách bố trí code ở trang index (php) 06/04/2007 23:01:04 (+0700) | #2 | 52072
[Avatar]
canh_nguyen
Elite Member

[Minus]    0    [Plus]
Joined: 23/08/2004 18:55:09
Messages: 775
Location: Broken dream
Offline
[Profile] [PM] [WWW] [Yahoo!] [MSN] [ICQ]
Code:
$act= $_GET['act'];
                  switch($act) {
                  default: include('include/home.php');
                  break; case "reg": include('include/register.php');
                  break; case "login": include('include/login.php');
                  break; case "search": include('include/search.php');
                  break; case "about": include('include/about.php');
         }


Bạn xem thử.
[Up] [Print Copy]
  [Question]   Hỏi cách bố trí code ở trang index (php) 07/04/2007 08:42:56 (+0700) | #3 | 52157
[Avatar]
hackervk
Member

[Minus]    0    [Plus]
Joined: 21/02/2007 17:02:13
Messages: 25
Offline
[Profile] [PM] [Email] [WWW]
mình sẽ cho bạn code của mình
<?
////////////////////////////////////////////////////////////////////////////////////
/// SOURCE MEIDA : BmT 3.0 ///
/// AUTHOR : BUI MINH THANH ///
/// HOMEPAGE : WWW.MINHTHANH.NET ///
/// THIS SOURCE IS NOT FREE OPEN SOURCE & PLEASE DON'T CHANGE COPYRIHGT ///
/// COPYRIGHT (C) 2006 BY BUI MINH THANH. ALLRIGHT SERVER. ///
/// SHOOL : Cong Nghiep HiShool (HB), HUT+Genetic College(HN) ///
/// HOA BINH TOWN - HOA BINH PROVICE - VIETNAM ///
//////////////////////////// CAU HINH KHOI DONG ////////////////////////////////////
ob_start();
include("cauhinh/_cauhinh.php");
include("cauhinh/_ketnoi.php");
connect_db();
ob_start();
session_start();
//////////////////////////// LOAD FUNCTIONS SU LY //////////////////////////////////
include("cauhinh/_key.php");
include("cauhinh/_chuyendoi.php");
include("cauhinh/_common.php");
include("cauhinh/_chucnang.php");
//////////////////////////// LAY COOKIE - USER HOAT DONG ///////////////////////////
$cookie = array();
$cookie["idtv"] = lay_cookie("idtv");
$cookie["matkhautv"] = lay_cookie("matkhautv");
$cookie["nick"] = lay_cookie("nick");
$cookie["skn"] = lay_cookie("skn");
$cookie["nn"] = lay_cookie("nn");
$idtv = $cookie["idtv"];
$matkhautv = $cookie["matkhautv"];
$nicktv = $cookie["nick"];
$skin_site = $cookie["skn"];
$lang_site = $cookie["nn"];
$_SESSION['idtv'] = $cookie["idtv"];
include("thanhphan/_thaydoi.php");
////////////////////////// THANG THONG KE AM NHAC //////////////////////////////////
$timezone = +6;
$time_chuan = gmdate("m", time() + 3600*($timezone+date("I")));
if($time_set!=$time_chuan)
{ $abc=mysql_query("select * from ".$tbfix."baihat");
while($tra=mysql_fetch_array($abc)){
$playthang = $tra["playthang"];
$downthang = $tra["downthang"];
$thang = $tra["thang"];
if($thang!=$time_chuan) {
$hoantat1=mysql_query("update ".$tbfix."baihat set thang='$time_chuan'");
$hoantat2=mysql_query("update ".$tbfix."baihat set playthang='0'");
$hoantat3=mysql_query("update ".$tbfix."baihat set downthang='0'");
}
}
$hoantat4=mysql_query("update ".$tbfix."cauhinh set noidung='$time_chuan' where id='14'");
}

////////////////////////////CAU TRUC HOAT DONG SITE ////////////////////////////////
if(isset($_GET['m'])){
switch($_GET['m']) {
case "" :
echo "<a href=http://minhthanh.net>Hacked by BmT</a>";
break;
case "Main" :
allscript(1);
break;
case "Cat" :
allscript(2);
break;
case "Sub" :
allscript(3);
break;
case "4" :
if($_GET['id']==1){
subscript(1);
} else if($_GET['id']==2){
subscript(2);
} else if($_GET['id']==3){
subscript(3);
} else if($_GET['id']==4){
subscript(4);
} else if($_GET['id']==5){
subscript(5);
} else if($_GET['id']==6){
subscript(6);
} else if($_GET['id']==7){
allscript(7);
} else if($_GET['id']==8){ //Thong Ke Nghe Nhieu
allscript(8);
} else if($_GET['id']==9){ //Thong ke Tai Nhieu
allscript(9);
} else if($_GET['id']==10){ //Tro giup
eval("duara(\"".duavao("trogiup/help")."\");");
} else if($_GET['id']==11){ //Su dung IDM
eval("duara(\"".duavao("trogiup/idm")."\");");
} else if($_GET['id']==12){ //About me
eval("duara(\"".duavao("trogiup/author")."\");");
} else if($_GET['id']==13){ //Loi bai hat
subscript(8);
} else if($_GET['id']==14){ //Thong bao bai hat bi loi
subscript(9);
} else if($_GET['id']==38){ //list ca si
subscript(38);
} else if($_GET['id']==15){ //Thong tin Album
album(1);
} else if($_GET['id']==16){ //Danh sach Album
album(2);
} else if($_GET['id']==17){ //Send Qua tang am nhac
eval("duara(\"".duavao("quatang/send")."\");");
} else if($_GET['id']==18){ //Qui dinh
eval("duara(\"".duavao("thanhvien/nq")."\");");
} else if($_GET['id']==19){ //Dang ky Interface
eval("duara(\"".duavao("thanhvien/dk")."\");");
} else if($_GET['id']==20){ //Dang ky
thanhvien(1);
} else if($_GET['id']==21){ //Dang nhap Interface
eval("duara(\"".duavao("thanhvien/dn")."\");");
} else if($_GET['id']==22){ //Quen Mat khau Interface
eval("duara(\"".duavao("thanhvien/quenmk")."\");");
} else if($_GET['id']==23){ //Dang nhap Post
thanhvien(2);
} else if($_GET['id']==24){ //Thong tin Ca Nhan Interface
thanhvien(3);
} else if($_GET['id']==25){ //Thay doi Mat Khau Interface
eval("duara(\"".duavao("thanhvien/doimk")."\");");
} else if($_GET['id']==26){ //Thay doi Thong Tin POST
thanhvien(4);
} else if($_GET['id']==27){ //Thay doi Mat Khau POST
thanhvien(5);
} else if($_GET['id']==28){ //Log Out
thanhvien(6);
} else if($_GET['id']==29){ //Thong bao
thongbao();
} else if($_GET['id']==30){ //Post Quen mat khau
thanhvien(8);
} else if($_GET['id']==31){ //Thong tin Casi
subscript(12);
} else if($_GET['id']==32){ // Doi Skin
subscript(13);
} else if($_GET['id']==33){ // Dang Online
subscript(14);
} else if($_GET['id']==34){ //Thay doi Mat Khau Interface
eval("duara(\"".duavao("trogiup/newfunc")."\");");
} else if($_GET['id']==35){ // Danh Gia
subscript(16);
} else if($_GET['id']==36){ // Change Language
subscript(17);
} break;
case "ThanhVien" :
thanhvien(7);
break;
case "Down" :
subscript(7);
break;
case "Play" :
play (1);
break;
case "PlayCasi" :
play (2);
break;
case "PlayAlbum" :
play (3);
break;
case "PlayList" :
play (4);
break;
case "News" :
if($_GET['id']=='View'){
news ();
}else{
viewnews ();
}
break;
case "Casi" :
allscript(4);
break;
case "Album" :
allscript(10);
break;
case "TimKiem" :
if($_GET['id']=="1"){
allscript(5);
} else if($_GET['id']=="2"){
allscript(6);
} else if($_GET['id']=="3"){
allscript(11);
} else if($_GET['id']=="4"){
album(3);
}
break;
case "QuaTang" :
subscript(10);
break;
case "YeuThich" :
subscript(15);
break;
}

}else{
website();
}


?>
[Up] [Print Copy]
  [Question]   Hỏi cách bố trí code ở trang index (php) 07/04/2007 10:04:07 (+0700) | #4 | 52185
[Avatar]
canh_nguyen
Elite Member

[Minus]    0    [Plus]
Joined: 23/08/2004 18:55:09
Messages: 775
Location: Broken dream
Offline
[Profile] [PM] [WWW] [Yahoo!] [MSN] [ICQ]

hackervk wrote:
mình sẽ cho bạn code của mình
<?
////////////////////////////////////////////////////////////////////////////////////
/// SOURCE MEIDA : BmT 3.0 ///
/// AUTHOR : BUI MINH THANH

 


Bạn là MINHTHANH? smilie
[Up] [Print Copy]
  [Question]   Hỏi cách bố trí code ở trang index (php) 07/04/2007 10:41:14 (+0700) | #5 | 52194
[Avatar]
gsmth
Elite Member

[Minus]    0    [Plus]
Joined: 15/02/2007 13:25:36
Messages: 749
Offline
[Profile] [PM] [WWW] [Yahoo!]
@hackervk: cho code vào tag [code ] [ / code], cho các bạn khác dễ đọc hơn.
[Up] [Print Copy]
  [Question]   Hỏi cách bố trí code ở trang index (php) 09/04/2007 00:27:19 (+0700) | #6 | 52544
[Avatar]
hackervk
Member

[Minus]    0    [Plus]
Joined: 21/02/2007 17:02:13
Messages: 25
Offline
[Profile] [PM] [Email] [WWW]
uh lần sau mình sẽ làm cam ơn vì đã nhắc nhở
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|