psdshow
金牌会员
 
论坛元老
UID 30908
精华
0
积分 1767
帖子 1369
金钱 1767 喜悦币
威望 0
人脉 0
阅读权限 70
注册 2004-9-6 来自 永州-廣州
状态 离线
|
这样一段代码有没有问题?
<?php
if($_GET['lang'] == 'en'){ setcookie('lang','en',time() + 86400); ?> <script>location.reload('index.php');</script> <?php }elseif($_GET['lang'] == 'tc'){ setcookie('lang','tc',time() + 86400); ?> <script>location.reload('index.php');</script> <?php }
if ($_COOKIE['lang'] == 'tc'){ ?> <script>location.reload('tc/index.htm');</script> <?php exit(); }elseif($_COOKIE['lang']== 'en'){ ?> <script>location.reload('en/index.htm');</script>--> <?php exit(); }else{ setcookie('lang','en',time() + 86400); ?> <script>location.reload('en/index.htm');</script> <?php }
?> tc/index.htm 是简体中文界面的html
代码
<a href="../index.php?lang=en" title="">切换到英文</a>
en/index.htm 是英文界面的html
代码
<a href="../index.php?lang=tc" title="">切换到中文</a>
遇到的问题是这样:
默认是到英文界面的
点击切换到中文界面后
直接在浏览器地址栏中删除地址 tc/index.htm
比如是中文的地址是 http://localhost/tc/index.htm
删除后就是 http://localhost/
按ENTER后
在IE7下仍然是跳转到 en/index.htm
而在firefox和safari都能正常跳转到 tc/index.htm
新开标签 http://localhost/
各个浏览器都能正常跳转到 tc/index.htm
问题在那里呢?
[ 本帖最后由 psdshow 于 2008-3-18 02:10 PM 编辑 ]
|  以下AD由PHPX赞助:
广州梦莎五金饰品厂 东莞恒隆五金饰品厂 承接php私活 |
|