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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.