Worldwide Posted May 4, 2010 Share Posted May 4, 2010 This code is giving me an error but i can't seem to understand why... Error: Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\onlineuser.php on line 9 CODE: <?php include("usersetup.php"); $filename = "onlineusers.html"; $html = ""; if (!file_exists($filename) or filemtime($filename) < time() - 1){ <body> <table width="780" height="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td valign="top"> <?php include_once('header.php'); ?> <h4>オンライン状況</h4> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> ゲームサーバー: <?php $query_R_characters = "SELECT * FROM characters WHERE OnlineStatus = 1 ORDER BY `Exp` DESC LIMIT 0,{$online_prayer_limit}"; $R_characters = mysql_query($query_R_characters, $l1jdb) or die(mysql_error()); $row_R_characters = mysql_fetch_assoc($R_characters); $totalRows_R_characters = mysql_num_rows($R_characters); if ($fs = @fsockopen($hostname_l1jdb, "2000", $errno, $errstr, 1)) { echo "<span style=\"color:#339933\">オンライン</span> 現在接続中のプレイヤー:<span style=\"color:#339933\">{$totalRows_R_characters}</span>"; fclose($fs); } else { echo "<span style=\"color:#FF3333\">オフライン</span>"; } ?> </td> </tr> </table> <?php if ($totalRows_R_characters > 0) { ?> <br /> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="2" nowrap="nowrap">Character</td> <td><div align="center">Level</div></td> <td>Clan</td> </tr> <?php do { ?> <tr> <td width="20" nowrap="nowrap" class="pd1"> <div align="left"> <?php if (file_exists($chagfx_small[$row_R_characters['Class']])) {echo "<img src=\"{$chagfx_small[$row_R_characters['Class']]}\">";} else {echo $classname[$row_R_characters['Class']];} ?> </div></td> <td nowrap="nowrap"><span class="pd3 fs14<?php if ($row_R_characters['Lawful'] > -1) {echo " blue";} else {echo " red";} ?>"><?php echo $row_R_characters['char_name']; ?></span></td> <td><div align="center"><?php echo $row_R_characters['level']; ?></div></td> <td nowrap="nowrap"><?php echo $row_R_characters['Clanname']; ?></td> </tr> <?php } while ($row_R_characters = mysql_fetch_assoc($R_characters)); ?> </table> <?php } mysql_free_result($R_characters); ?> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/200616-an-online-user-code-giving-an-error/ Share on other sites More sharing options...
Alex Posted May 4, 2010 Share Posted May 4, 2010 You never closed off the first block of PHP. <?php include("usersetup.php"); $filename = "onlineusers.html"; $html = ""; if (!file_exists($filename) or filemtime($filename) < time() - 1){ ?> ... Quote Link to comment https://forums.phpfreaks.com/topic/200616-an-online-user-code-giving-an-error/#findComment-1052780 Share on other sites More sharing options...
Worldwide Posted May 4, 2010 Author Share Posted May 4, 2010 I closed it off, And I get this error: Parse error: syntax error, unexpected $end in C:\xampp\htdocs\onlineuser.php on line 61 Quote Link to comment https://forums.phpfreaks.com/topic/200616-an-online-user-code-giving-an-error/#findComment-1052788 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.