wro Posted May 26, 2010 Share Posted May 26, 2010 Hello, tinkering around with my code (which worked) and I've attempted to use frames and the php is having errors. I've tried including html tags, using echo all through (escaping quotes) etc, and I just can't figure it out =/ It returns Parse error: syntax error, unexpected '<' in xxxxxxxxxxxxx/content.php on line 19 (line 19 is print "it worked"..ironically) Many thanks in advance. <?php //INDEX session_start(); include 'connect.php'; ?> <center> <h1>lets hope it connects..</h1> </center><br><br> <link rel="stylesheet" href="style.css" type="text/css"> <?php if (isset($_SESSION['player'])) { $player=$_SESSION['player']; $userstats="SELECT * from database where playername='$player'"; $userstats2=mysql_query($userstats) or die("Could not get user stats"); $userstats3=mysql_fetch_array($userstats2); print "it worked =)";<br> <a href="fight.php">Kill A Creature!</a><br> if($userstats3[dead]=='Yes') { print "You're dead.<br>"; } } else { print "Sorry, not logged in please <A href='login.php' target="content.php">Login</a><br>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/202930-php-and-frames/ Share on other sites More sharing options...
trq Posted May 26, 2010 Share Posted May 26, 2010 You have html after the ; on that line, which continues onto the next line. Quote Link to comment https://forums.phpfreaks.com/topic/202930-php-and-frames/#findComment-1063441 Share on other sites More sharing options...
kalivos Posted May 26, 2010 Share Posted May 26, 2010 Like thorpe stated, the correct code should be: <?php //INDEX session_start(); include 'connect.php'; ?> <center> <h1>lets hope it connects..</h1> </center><br><br> <link rel="stylesheet" href="style.css" type="text/css"> <?php if (isset($_SESSION['player'])) { $player=$_SESSION['player']; $userstats="SELECT * from database where playername='$player'"; $userstats2=mysql_query($userstats) or die("Could not get user stats"); $userstats3=mysql_fetch_array($userstats2); print "it worked =) <br> <a href=\"fight.php\">Kill A Creature!</a><br>"; if($userstats3[dead]=='Yes') { print "You're dead.<br>"; } } else { print "Sorry, not logged in please <A href='login.php' target="content.php">Login</a><br>"; } ?> Please read for future reference: http://gulati.info/2010/01/many-ways-to-integrate-html-into-php/ Quote Link to comment https://forums.phpfreaks.com/topic/202930-php-and-frames/#findComment-1063443 Share on other sites More sharing options...
wro Posted May 26, 2010 Author Share Posted May 26, 2010 Thanks to you all, knew it was something simple (need to stop doing this so late at night =P) Quote Link to comment https://forums.phpfreaks.com/topic/202930-php-and-frames/#findComment-1063445 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.