-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex1.php
74 lines (69 loc) · 1.63 KB
/
index1.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?require("system/model/config.php") ?>
<? require("system/model/common_start.php") ?>
<? require("system/model/function.php") ?>
<? require("system/model/tiengviet.php") ?>
<?php
//META and FACEBOOK
?>
<?php
$url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . $_SERVER['QUERYSTRING'];
$urlParts = explode('.', $_SERVER['HTTP_HOST']);
if(strpos($url, 'www'))
{
$subdomain_value = $urlParts[1]; // có “www”
}
else
{
$subdomain_value = $urlParts[0]; // không có “www”
}
if($subdomain_value == 'dev' || $subdomain_value == 'DEV')
{
// viết hàm thực thi riêng cho subdomain gianhang.shopcantho.vn
}
else
{
// viết hàm thực thi riêng cho domain chính shopcantho.vn
} ?>
<?php
$ok1=array("www.");
$ok2=array("");
?>
<?php
if($_SERVER['SERVER_NAME']=='localhost')
{?>
<?}else{?>
<?}?>
<?
if($row['domain']==str_replace($ok1,$ok2,$_SERVER["SERVER_NAME"]))
{?>
<!--kiem tra khi co ten mien-->
<?if($tem=='')
{?>
<?include("template/mobile/index.php");?>
<?}else{?>
<?php if($row_mobile['mobile']=='0')
{?>
<?include($tem);?>
<?}else{?>
<?include("system/model/mobile.php");?>
<?}?>
<?}?>
<!--end kiem tra khi co ten mien-->
<?}elseif($subdomain_value==$user){?>
<!--kiem tra khi co subdomain-->
<?if($tem=='')
{?>
<?include("template/mobile/index.php");?>
<?}else{?>
<?php if($row_mobile['mobile']=='0')
{?>
<?include($tem);?>
<?}else{?>
<?include("system/model/mobile.php");?>
<?}?>
<?}?>
<!--end kiem tra subdomain-->
<?}else{?>
<?php include("system/model/mobile_home1.php");?>
<?}?>
<?require("system/model/common_end.php") ?>