Jump to content


Photo

need help


  • Please log in to reply
4 replies to this topic

#1 stringsbeast

stringsbeast
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 May 2006 - 10:19 PM

im getting this error
on my other file it is the same and it works but on this one im getting this

PHP Parse error: parse error, unexpected T_STRING in C:\Documents and Settings\Kevin\Mijn documenten\monsters.php on line 139

<?php
if (!$action && !$battle) {
print "Welcome to the Monster battle arena.<br><br>
- <a href=monsters.php?action=monsterlist>List all monsters</a>.<br>
}

if ($action == monsterlist) {
line 139   print "Showing all monsters...<br>";
print "<table><tr><td width=20><b><u>ID</td><td width=100><b><u>Name</td><td width=100><b><u>Options</td></tr>";
$esel = mysql_query("select * from players where level=$stat[level] and hp>0 limit 5000 ");
while ($elist = mysql_fetch_array($esel)) {
print "<tr><td>$elist[id]</td><td><a href=view.php?view=$elist[id]>$elist[user]</a></td><td>- <A href=battle.php?battle=$elist[id]>Attack</a></td></tr>";
}
print "</table><br>";
print "Or you can always... <a href=monsters.php>go back</a>.";
}


#2 Ferenc

Ferenc
  • Members
  • PipPipPip
  • Advanced Member
  • 94 posts

Posted 27 May 2006 - 10:33 PM

print "Welcome to the Monster battle arena.<br><br>
- <a href=monsters.php?action=monsterlist>List all monsters</a>.<br>";
You forgot to end the print
Everything you want to know is here.

#3 stringsbeast

stringsbeast
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 May 2006 - 10:38 PM

actually its this line thats giving the error
print "Showing all monsters...<br>";
but thx for telling that

#4 Ferenc

Ferenc
  • Members
  • PipPipPip
  • Advanced Member
  • 94 posts

Posted 27 May 2006 - 10:46 PM

[!--quoteo(post=377670:date=May 27 2006, 04:38 PM:name=stringsbeast)--][div class=\'quotetop\']QUOTE(stringsbeast @ May 27 2006, 04:38 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
actually its this line thats giving the error
print "Showing all monsters...<br>";
[/quote]


unexpected T_STRING errors are generaly located in the lines above the error code.

Since you didnt end the print, php looks for a " ,since that is how you started it, it therfore needs to end some where. after that is also expects an end --> ;
Your code errors in line 139 because that is where the nearest double quote is located.
Everything you want to know is here.

#5 stringsbeast

stringsbeast
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 May 2006 - 10:50 PM

ok thx
got rid off that error




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users