Parse error: syntax error, unexpected '}' in ... on line 24

 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
<?php
include "rss.inc";
include "conn.inc";
$flag = false;
function getIP()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) // Определение IP-адреса
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
$result = mysql_query('select * from rss');
while ($reader = mysql_fetch_array($result))
{
if ($reader[ip] == getIP()) {$flag = true}
if ($flag == false) {mysql_query('insert INTO `rss` ( `id`, `ip`, `date`) VALUES (null, getIP(), NOW()');}
}