T String Error

Having problems with T-string error , Not sure what to do.

Page 1 of 1

1 Replies - 2317 Views - Last Post: 10 April 2008 - 10:48 AM Rate Topic: -----

#1 hennerz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-April 08

T String Error

Posted 10 April 2008 - 04:40 AM

Hello, I am currently making a website, and for the online list, i would like admins, to be in a red colour. This is what I have wrote in the script, but everything I try and change still comes up with a T-String error.

Please can someone correct my error

<?php
$ctime = time();
$osel = mysql_query("select * from players");
while ($online = mysql_fetch_array($osel)) {
	$span = ($ctime - $online[lpv]);
	if ($span <= 180) {
		print "<a href=view.php?view=$online[id]>$online[user]</a> ($online[id])<br>";
}
[u]if ($stat[rank] == Admin){[/u]print "<a href="view.php?view=$online[id]><font color=red>$online[user]</a> ($online[id])<br>"; 


			?>



At the if ($stat[rank] == Admin){ part, thats the line where the error apears.

Thanks

Hennerz

Is This A Good Question/Topic? 0
  • +

Replies To: T String Error

#2 Mike007  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 7
  • View blog
  • Posts: 332
  • Joined: 30-August 07

Re: T String Error

Posted 10 April 2008 - 10:48 AM

Admin, is either a constant, and should be written as ADMIN for better readibilty (and to keep some good coding standards). Or, admin is a variable, in that case you forgot the dollar sign $Admin, or admin is a string and you forgot the quote marks around it.

BTW, try following coding standards to achieve a better style, it will help you in the end, not someone else.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1