HoTDaWg Posted January 29, 2007 Share Posted January 29, 2007 hey guys,i have a script here and it is pretty well written to my standard, its just that it says already, on line 5 there is a syntax error. it looks fine to me:S maybe im just tired. here is the script:[b]mainpagefunctions.php[/b][code]<?phpinclude "config.php";include "theworks.php";define('inStereo',true);?><?phpfunction checkuser(){ //Select from the table where the users ip is the same and the status is normal $getinfo= "SELECT ip,status FROM users (`id`, `ip`, `voted`,`status`) WHERE ip="userip" AND status="normal""; $getinfonow= mysql_query($getinfo); if(mysql_num_rows=>1){ echo'<table width="100%" height="0" cellpadding="0" cellspacing="0" border="0" style="border: 1px solid #990000;"><tr bgcolor="#FFCCCC"><td>Our records show you have been on this website before, however, we suggest you visit the <a href="index.php?mode=answer&question=newuser">new user page</a> for complete and brief instructions, explanations, and guidelines.</td></tr></table>'; } //Select from the table where the users ip is there, but he/she is banned $getinfo= "SELECT ip,status FROM users (`id`, `ip`, `voted`,`status`) WHERE ip="userip" AND status="banned""; $getinfonow= mysql_query($getinfo); if(mysql_num_rows=>1){ echo'<table width="100%" height="0" cellpadding="0" cellspacing="0" border="0" style="border: 1px solid #990000;"><tr bgcolor="#FFCCCC"><td>Our Records show you have been banned. <a href="index.php?mode=answer&question=banned">Click here</a> for more information.</td></tr></table>'; exit(); } //Select from the table where the users ip is there $getinfo= "SELECT ip,status FROM users (`id`, `ip`, `voted`,`status`) WHERE ip="userip""; $getinfonow= mysql_query($getinfo); if(!mysql_num_rows=>1){ echo'<table width="100%" height="0" cellpadding="0" cellspacing="0" border="0" style="border: 1px solid #990000;"><tr bgcolor="#FFCCCC"><td>There appears to be an error on this page. <a href="index.php?mode=answer&question=scripterror">Click here for more information.</td></tr></table>'; }else{ $status="normal"; $getinfo= "INSERT INTO users (`id`, `ip`, `voted`,`status`) VALUES ('','"userip"','','"$status"')"; echo'<table width="100%" height="0" cellpadding="0" cellspacing="0" border="0" style="border: 1px solid #990000;"><tr bgcolor="#FFCCCC"><td>Our records show this is your first time on our website, we suggest you visit the <a href="index.php?answer=newuser">new user page</a> for complete and brief instructions, explanations, and guidelines.</td></tr></table>';}checkuser(); ?>[/code]the error i get is:[code]Parse error: syntax error, unexpected T_STRING in /home/idanc48d/public_html/v2/mainpagefunctions.php on line 9[/code] Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 29, 2007 Share Posted January 29, 2007 $getinfo= "SELECT ip,status FROM users (`id`, `ip`, `voted`,`status`) WHERE ip="userip" AND status="normal"";you exit the string, see the color change in your code?$getinfo= "SELECT ip,status FROM users (`id`, `ip`, `voted`,`status`) WHERE ip='userip' AND status='normal'"; Quote Link to comment Share on other sites More sharing options...
HoTDaWg Posted January 29, 2007 Author Share Posted January 29, 2007 yep, im tired. thanks jesirose! 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.