simmsy Posted December 2, 2011 Share Posted December 2, 2011 Hi im having trouble with this coding and this error: 'Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/fightwa1/public_html/fightrd1.php on line 1' <?php include 'connect.php'; include 'fightheaderrd1.php'; session_start(); $username = $_SESSION['loginusername']; if (isset($_SESSION['loginusername'])){ echo "<center><h2>Round 1</h2></center><br /><br />"; $result = mysql_query("SELECT * FROM boxerinfo WHERE username = '$username' AND status = 'online'"); while($row = mysql_fetch_array($result)) { echo "<div id='bluecorner'><table border='1' bordercolor='#000000' width='150' align='center'>"; echo "<tr bgcolor='#0000FF'>"; echo "<th align='center'><font color='#FFFFFF'>".$row['username']."</font></th>"; echo "</tr>"; echo "</table></div>"; } $result2 = mysql_query("SELECT * FROM boxerinfo WHERE fighterrequest = '$username' AND status = 'online'"); while($row2 = mysql_fetch_array($result2)) { echo "<div id='redcorner'><table border='1' bordercolor='#000000' width='150' align='center'>"; echo "<tr bgcolor='#990002'>"; echo "<th align='center'><font color='#FFFFFF'>".$row2['username']."</font></th>"; echo "</tr>"; echo "</table></div>"; } ?> <script src="http://jqueryjs.googlecode.com/files/jquery-1.3.1.min.js" type="text/javascript">/* script comment */</script> <div id="display"></div> <script type="text/javascript"> //<![CDATA[ // Number of seconds to wait between refreshes var seconds = 10; // Function to handle refreshing every iteration var refresher = function() { // Adding data to the request forces the POST method to be used by jQuery // rather than adding something useless like a timestamp, // send something like the location of the calling page var data_to_send = {location: window.location}; // Load the contents of the page into the <div> $('#display').load('fightlivecommentary.php'); } // Set the function up to execute every "seconds" seconds // Save a reference to the interval so we can stop it with "clearInterval(refreshing)" later var refreshing = setInterval(refresher, seconds * 1000); //]]> </script> <? }else{ echo "Please <b>Sign In</b> above or <a href='signup.php'><b>Sign Up</b></a> to create your boxer!</a>"; } include 'footer.php'; ?> Thanks for any help Quote Link to comment https://forums.phpfreaks.com/topic/252337-parse-error-syntax-error-unexpected-t_constant_encapsed_string-please-help/ Share on other sites More sharing options...
Maq Posted December 2, 2011 Share Posted December 2, 2011 In the future, please place OR tags around your code. Quote Link to comment https://forums.phpfreaks.com/topic/252337-parse-error-syntax-error-unexpected-t_constant_encapsed_string-please-help/#findComment-1293644 Share on other sites More sharing options...
Maq Posted December 2, 2011 Share Posted December 2, 2011 Use <?php instead of shorthand. Quote Link to comment https://forums.phpfreaks.com/topic/252337-parse-error-syntax-error-unexpected-t_constant_encapsed_string-please-help/#findComment-1293647 Share on other sites More sharing options...
simmsy Posted December 2, 2011 Author Share Posted December 2, 2011 ive edited that but still the same error, any other ideas? Quote Link to comment https://forums.phpfreaks.com/topic/252337-parse-error-syntax-error-unexpected-t_constant_encapsed_string-please-help/#findComment-1293681 Share on other sites More sharing options...
Pandemikk Posted December 3, 2011 Share Posted December 3, 2011 I'm assuming the code you have provided is the contents of: "fightrd1.php" Everything looks fine to me. Can you double check that you have nothing before the initialize <?php tag in your script? Quote Link to comment https://forums.phpfreaks.com/topic/252337-parse-error-syntax-error-unexpected-t_constant_encapsed_string-please-help/#findComment-1293728 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.