Jump to content

[SOLVED] ?confused?


maxso

Recommended Posts

Hi, in this script I have tried to find the users ip and see if it is in the database. Currently I have been having problems.

 

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

 

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

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

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

$ip_exist=mysql_num_rows($get)

if($ip_exist > 0){
echo "welcome again"
}
?> 

</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/138215-solved-confused/
Share on other sites

Thank you for that, im always forgetting them.

 

Also, when i add an else statement it gives me an error.

 

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

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

Link to comment
https://forums.phpfreaks.com/topic/138215-solved-confused/#findComment-722602
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.