Jump to content

[SOLVED] Am i missing a bracket somewhere?


maxso

Recommended Posts

I have a problem where it says

 

Parse error: parse error, unexpected $ in /home/www/cooladverts.freehostia.com/index.php on line 26

 

It says the last line which is

</html>

 

<html>
<head />
<body>
<?php 
$ip=$_SERVER['REMOTE_ADDR'];

$con=mysql_connect('****************','******','******');
mysql_select_db('*****');

$get=mysql_query("SELECT ip FROM server1 WHERE IP='$ip'");

$ip_exist=mysql_num_rows($get);
$add_new=mysql_query("INSERT INTO server1 (IP, count)
VALUES ('$ip', '1')");


if($ip_exist > 0){
  echo "welcome again";
} else {
  echo "new user";
?> 

</body>
</html>

 

This only happened when I added this part of the script

 

$add_new=mysql_query("INSERT INTO server1 (IP, count)
VALUES ('$ip', '1')");

 

Am I missing a bracket or something?

Link to comment
https://forums.phpfreaks.com/topic/138228-solved-am-i-missing-a-bracket-somewhere/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.