Jump to content

[SOLVED] strange error:S


HoTDaWg

Recommended Posts

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]
<?php
include "config.php";
include "theworks.php";
define('inStereo',true);
?>
<?php
function 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]
Link to comment
https://forums.phpfreaks.com/topic/36247-solved-strange-errors/
Share on other sites

$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'";
Link to comment
https://forums.phpfreaks.com/topic/36247-solved-strange-errors/#findComment-172298
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.