【发布时间】:2014-05-04 07:15:14
【问题描述】:
我想将用户重定向到我的网站的移动版本。
重定向工作正常,但是 php 变量没有通过。
我正在使用以下内容:
<script>
if ($(window).width() < 480 || $(window).height() < 480) {
var searchproducts = "<?php $_GET['search']?>";
var category = "<?php $_GET['cat']?>";
var page="http://m.website.com/search.php?search="+searchproducts+"&cat="+category;
document.location.href=page;
}
</script>
我也试过了:
<script>
if ($(window).width() < 480 || $(window).height() < 480) {
window.location.replace("http://m.website.com/search.php?search=<?php $_GET['search']?>&cat=<?php $_GET['cat']?>");
}
</script>
谁能帮忙?
谢谢
【问题讨论】:
标签: javascript php redirect mobile