maxso Posted December 23, 2008 Share Posted December 23, 2008 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? Quote Link to comment Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 Never closed your ELSE statement. I remember posting this for you before... if($ip_exist > 0){ echo "welcome again"; } else { echo "new user"; } ?> Quote Link to comment Share on other sites More sharing options...
maxso Posted December 23, 2008 Author Share Posted December 23, 2008 Tis not my day today. solved Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.