onyxblack Posted November 14, 2008 Share Posted November 14, 2008 Parse error: syntax error, unexpected T_ELSEIF in C:\wamp\www\work.php on line 18 My first time i've had to use time though the error is happening before it even gets that far, (will it let me do math like that?) <?php include('incl/login.conf.php'); mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_PASS); mysql_select_db(MYSQL_DB); $ip = mysql_query("select ip FROM timetoclick WHERE ip='".$_SERVER['REMOTE_ADDR']."'"); while($fetchip = mysql_fetch_array( $ip )) $time = mysql_query("select time FROM timetoclick WHERE ip='".$_SERVER['REMOTE_ADDR']."'"); while($fetchtime = mysql_fetch_array( $time )) if ($fetchip['ip'] != $_SERVER['REMOTE_ADDR']); { mysql_query("INSERT INTO timetoclick (time, ip) VALUES ('".time()."', '".$_SERVER['REMOTE_ADDR']."')"); echo "New<br>"; } elseif ($fetchtime['time']-43200>time()); { echo "You have allreact been attacked. You can not be attacked by this person for X"; echo " more seconds."; } else ($fetchtime['time']-43200<time()); { echo "New<br>"; mysql_query("INSERT INTO timetoclick (time, ip) VALUES ('".time()."', '".$_SERVER['REMOTE_ADDR']."')"); } ?> Quote Link to comment Share on other sites More sharing options...
DarkWater Posted November 14, 2008 Share Posted November 14, 2008 You have a semicolon after the if and elseif and else. Remove those. Quote Link to comment Share on other sites More sharing options...
onyxblack Posted November 14, 2008 Author Share Posted November 14, 2008 heh, well still a noob at this... Ok, so after removing those I'm getting, Parse error: syntax error, unexpected '{' in C:\wamp\www\work.php on line 24 And after removing the '{' I'm getting, Parse error: syntax error, unexpected T_STRING in C:\wamp\www\work.php on line 25 >.< Quote Link to comment Share on other sites More sharing options...
DarkWater Posted November 14, 2008 Share Posted November 14, 2008 Didn't even notice that. Else blocks are not allowed to have any conditions. Put the { back and remove the stuff in ( ) after else. Quote Link to comment Share on other sites More sharing options...
onyxblack Posted November 14, 2008 Author Share Posted November 14, 2008 Thanks a bunch man, now im getting a SQL syntax error, but i should be able to fix that on my own. Thank you! 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.