Quote:
syntax error, unexpected '$_SERVER' (T_VARIABLE) on line 7
This means that
$ip=$_SERVER['REMOTE_ADDR'] $_SERVER["REMOTE_ADDR"] : '127.0.0.1';
^ at this point, you code is not php any more.
Solution depends on what you intend to di there.
Just a guess: Did you tried to use the ternary operator ?
In this case, correction is
$ip=$_SERVER['REMOTE_ADDR'] ? $_SERVER["REMOTE_ADDR"] : '127.0.0.1';
^ missing question mark