I want it to get you to a different location. Deep lake if you are Level 20 and Dark Cave if you are 40. And if you aren't the requiered level it will say: "You are not high level enough for this location", And it will send you back to the previous location. Also when you travel to a location it will
cost ''X'' gold. And if you haven't got the money, "You don't have enough gold for this trip" Or something like that. but can't figure out how to do it, just getting errors etc., Hope you know what I mean. (by the way: It says errror: Line 52, 53, 54 (marked) and it warns for error with $location.
Thanks!
Code: Select all
<?php
include_once 'connect.php';
session_start();
include 'logo.php';
?>
 <link href="style.css" rel="stylesheet" type="text/css" />
<div id="location">
<?php
if (isset($_SESSION['player']))
{
  $player=$_SESSION['player'];
}
else
{
  echo "Not Logged in <br><br> <A href='loginpage.php'>Click here for Loginpage!</a>";
  exit;
}
?>
</div>
<?php
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
include_once 'statpanel.php';
 ?>
 <div id ="locations">
 <?php
$playerhp = $playerinfo3['stamina'];
if ($playerhp < 1)
{
  echo "You are dead!" ;
  echo "<br><a href='useitem.php>Use an Item";
  exit;
}
if (isset($_GET['map']))
{
$bypass=1;
echo "<a href='index.php?mapchange=1&mapname=Forbidden Forest'>Forbidden Forest<br>";
echo "<br><a href='index.php?mapchange=1&mapname=Deep Lake'>Deep Lake<br>";
echo "<br><a href='index.php?mapchange=1&mapname=The Dark Cave'>The Dark Cave<br>";
}
if(isset($_GET['mapchange']))
{
$bypass=1;
$mapname = $_GET['mapname'];
$name = $locations['name'];  <-----------Line 52,53 etc.
$level = $locations['level'];
$price = $locations['price'];
$gold = $price['gold'];
$updateplayer="update players set location='$mapname' where name='$playerinfo3[name]'";
  mysql_query($updateplayer) or die("Could not update player");
$updateplayer="update players set gold='$gold' where name='$player'";
{
 echo "You do not have enough gold for this trip!";
   echo "<center><a href='index.php'>Go Back</center>";
  exit;
if ($playerinfo3['level'] > $location['level'])
{
echo "You are not high level enough to get to this Area!";
echo "<center><a href='index.php'>Go Back</center>";
exit;
  if (playerinfo3['gold'] = location['price'])
{
echo "You have traveled to " . $mapname . ".<br>";
echo "<a href='index.php'>To location</a><br>";
exit;
}
if($bypass = 1)
{
echo "<br><b><big><u>" . $playerinfo3['location'] . "</u></big><br>";
echo "<br><b><big><u>Locations</u></big></b>";
echo "<br><a href='store.php'>Visit Store<br>";
echo "<a href='inn.php'>Visit Innkeeper<br>";
echo "<a href='spelltrainer.php'>Visit Spell trainer<br>";
echo "<a href='useitem.php'>Use Items<br>";
echo "<a href='armorshop.php'>Visit Armorshop!<br>";
echo "<a href='weaponshop.php'>Visit Weaponshop<br>";
echo "<a href='battle.php'>Battle in Arena<br>";
echo "<a href='game.php?map=1'>Go to Map</a><br>";
}
}
?>
</div>
<div id="logout">
<?php
echo "<br><a href='logout.php'><img src='images/logout.gif'>";
?>
</div>




