这是我的javascript代码
<script type="text/javascript">
var country,url;
country = geoip_country_code()
if(country=="US"){
url="http://www.site.org/index.php?user=php variable";
}
setTimeout("location.href = url;",5000);
</script>
我需要将$_GET['user']
php 变量用于在当前 url 中获取用户名
试过这个但不起作用
if(country=="US"){
url="http://www.site.org/index.php?user=<?php echo $_GET['user']; ?>";
}