Jump to content

php and frames.


wro

Recommended Posts

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>";
  
  }

?>

Link to comment
https://forums.phpfreaks.com/topic/202930-php-and-frames/
Share on other sites

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/

Link to comment
https://forums.phpfreaks.com/topic/202930-php-and-frames/#findComment-1063443
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.