php 语法错误,PHP语法错误?

我编写了一个很好的脚本,但我不断得到

Error on line 29: Parse error, unexpected T_IF(if)我试过调试代码,浪费了大量的时间。但没有,出来。

这是我的代码。

include("geoip.inc");

$ip=$_SERVER['REMOTE_ADDR'];

$gi = geoip_open("GeoIP.dat",GEOIP_STANDARD);

$country_code = geoip_country_code_by_addr($gi, "$ip");

$referrer=$_SERVER['HTTP_REFERER'];

// Country name is not used so commented

// Get Country Name based on source IP

//$country = geoip_country_name_by_addr($gi, "$ip");

$real=0;

geoip_close($gi);

if(strstr(strtolower($_SERVER['HTTP_USER_AGENT']), "googlebot")) {

$real = 1;

}

else {

if ($_COOKIE['iwashere'] != "yes") {

setcookie("iwashere", "yes", time()+315360000);

if ($country_code="IN") {

if(preg_match('/google/i', $referrer)) {

$key = "g17x9erm28n7cgifddssfqhgorjf3e"; // Account API Key

$ip = $_SERVER['REMOTE_ADDR']; // IP to Lookup

$result = file_get_contents('http://www.ipqualityscore.com/api/ip_lookup.php?KEY='.$key.'&IP='.$ip);

$real=$result

//$result will be equal to 1 for detected proxies & vpns or equal to 0 for clean IP's

{if($real==0)

{setcookie("testcookie", "testvalue");

if( isset( $_COOKIE['testcookie'] ) ) {

if (isset($_POST['jstest'])) {

$nojs = FALSE;

} else {

// create a hidden form and submit it with javascript

echo '

';

echo '';

echo '

echo 'document.jsform.submit();';

echo '';

echo '

';

// the variable below would be set only if the form wasn't submitted, hence JS is disabled

$nojs = TRUE;

}

if ($nojs){

$real=1;

}

}

else

$real=1;

}

else

$real=1;

} else

$real = 1;

}

else {

$real = 1;

}

} }

if ($real==1) {

include_once('Biggenius1.htm');

}

?>这是如果里面。请给我建议,我该如何避免这些错误。还有没有其他方法可以将这种复杂的脚本与多个嵌套的if语句进行编码?

请发布完整的代码:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值