statpanel:Notice: Use of undefined constant level - assumed 'level' in C:\wamp\www\tutorial\statpanel.php on line 22
Notice: Use of undefined constant level - assumed 'level' in C:\wamp\www\tutorial\statpanel.php on line 22
Notice: Use of undefined constant exper - assumed 'exper' in C:\wamp\www\tutorial\statpanel.php on line 23
Code: Select all
<div id="lpanel">
<?php
echo "<u><b> " . $playerinfo3['name'] . "</b></u><br>";
echo $playerinfo3['pclass'] . "<br>";
//////////////new for 17
echo "Level " . $playerinfo3['level'] . "<br>";
echo "Attack = " . $playerinfo3['attack'] . "<br>";
echo "Defense = " . $playerinfo3['defense'] . "<br>";
echo "Hit Points<br>";
echo "Spell Points<br><br>";
echo "<b><big><u>Gold</u></big></b><br>";
echo $playerinfo3['gold'];
?>
<?php
echo "<br><br>";
echo "<a href='equipment.php'>Equipment<br></a>";
////////////////////////new for video 17////////////////
echo"<br>";
$expneeded = ($playerinfo3[level] * 100) * $playerinfo3[level];
if ($playerinfo3[exper] >= $expneeded)
{ echo "<br><a href='levelup.php'>Level Up!!</a>";}
?>
</div>
<div id= "hpointsback">
<?php
echo "<img src='images/barback.png'>";
?>
</div>
<div id= "hpoints">
<?php
$width = ($playerinfo3['hpoints'] / $playerinfo3['maxhp']) * 100;
echo "<img src='images/hpoints.png' width='$width' height='15' >";
?>
</div>
<div id= "spointsback">
<?php
echo "<img src='images/barback.png'>";
?>
</div>
<div id= "spoints">
<?php
$width = ($playerinfo3['spoints'] / $playerinfo3['maxspoints']) * 100;
echo "<img src='images/spoints.png' width='$width' height='15' >";
?>
</div>
weaponshop:Notice: Undefined variable: bypass in C:\wamp\www\tutorial\weaponshop.php on line 94
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\weaponshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\weaponshop.php on line 118
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\weaponshop.php on line 119
Code: Select all
<?php
include_once 'connect.php';
session_start();
include_once 'logo.php';
?>
<link href="style.css" rel="stylesheet" type="text/css" />
<?php
if (isset($_SESSION['player']))
{
$player=$_SESSION['player'];
}
else
{
echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
exit;
}
$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>
<div id="table">
<?php
$pllocation=$playerinfo3['location'];
//////////////////////////new for video 18/////////////
$inninfo="SELECT * from locations where location='$pllocation' AND type='weaponshop'";
$inninfo2=mysql_query($inninfo) or die("could not get player stats!");
$inninfo3=mysql_fetch_array($inninfo2);
if (isset($_GET['bought']))
{
$bypass = 1;
$id=$_GET['id'];
$playerid = $playerinfo3['id'];
$class = $playerinfo3['pclass'];
$level = $playerinfo3['level'];
$iteminfo="SELECT * from weapons where id='$id'";
$iteminfo2=mysql_query($iteminfo) or die("could not get item stats!");
$iteminfo3=mysql_fetch_array($iteminfo2);
if ($playerinfo3['gold'] < $iteminfo3['price'])
{
echo "You do not have enough Gold for this purchase!";
echo "<center><a href='index.php'>Go Back</center>";
exit;
}
if ($playerinfo3['pclass'] != $iteminfo3['class'] && $iteminfo3['class'] != "any")
{
echo "You are not the right class for this item!";
echo "<center><a href='index.php'>Go Back</center>";
exit;
}
if ($playerinfo3['level'] < $iteminfo3['level'])
{
echo "You are not high enough level to use this item!";
echo "<center><a href='index.php'>Go Back</center>";
exit;
}
$name = $iteminfo3['name'];
$rating = $iteminfo3['rating'];
$wlevel = $iteminfo3['level'];
$hittext = $iteminfo3['hittext'];
$damage = $iteminfo3['damage'];
$randid = rand(1000,999999999);
$percentage = $iteminfo3[price] / 100;
$price = $iteminfo3[price] * $percentage;
$newprice = $price + $iteminfo3[price];
$newprice = (int)$newprice;
$itembought = "INSERT into playerweapons(pid, name, rating, level, randid,price,class,hittext,damage) VALUES ('$playerid','$name','$rating','$wlevel','$randid','$newprice','$class','$hittext','$damage')";
mysql_query($itembought) or die("could not insert weapon into backpack");
$updateplayer="update players set gold=gold-'$newprice' where name='$player'";
mysql_query($updateplayer) or die("Could not update player");
echo $name . " Purchased<br>";
echo $inninfo3['exitgreet'] . "<br>";
echo "<a href='index.php'>Go Back</center>";
}
if ($bypass != 1)
{
$counter = 0;
$class = $playerinfo3['pclass'];
$level = $playerinfo3['level'];
echo "<center>" . $inninfo3['greeting'] . "<br>";
echo "<small>";
print "<center>";
print "<table border='0' width='70%' cellspacing='20'>";
print "<tr><td width='25%' valign='top'>";
print "</td>";
print "<td valign='top' width='75%'>";
$invinfo="SELECT * from weapons where class = '$class' AND level <= '$level' || class='any'";
$invinfo2=mysql_query($invinfo) or die("could not select anything from the store.");
print "<table border='1' bordercolor='white' bgcolor='#ffffff'>";
print "<tr><td>Name<font color='ffffff'>________________</td><td>Rating<font color='ffffff'>______</td><td>Price<font color='ffffff'>______</td><td><font color='ffffff'>________________</td></tr>";
while($invinfo3=mysql_fetch_array($invinfo2))
{
$counter = 1;
$percentage = $invinfo3[price] / 100;
$price = $invinfo3[price] * $percentage;
$newprice = $price + $invinfo3[price];
$newprice = (int)$newprice;
print "<tr><td>$invinfo3[name]</td><td>$invinfo3[rating]</td><td>$newprice</td><td><A href='weaponshop.php?id=$invinfo3[id]&bought=1'>Buy Weapon</td></tr>";
}
print "</table>";
print "</td></tr></table>";
print "</center>";
echo "</small>";
if ($counter == 0)
{
echo "<center>There is nothing in the store at this time.<br>";
echo "<a href='index.php'>Go Back</center>";
exit;
}
echo "<center><a href='index.php'>NeverMind</center></a>";
}
?>
</div>
armorshop:Notice: Undefined variable: bypass in C:\wamp\www\tutorial\armorshop.php on line 97
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 116
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 118
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 116
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 118
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 116
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 118
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 116
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 118
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 116
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 118
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 116
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 118
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 116
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 118
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 116
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 118
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 116
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 118
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 116
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 118
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 116
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 118
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 116
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 118
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 116
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 117
Notice: Use of undefined constant price - assumed 'price' in C:\wamp\www\tutorial\armorshop.php on line 118
Code: Select all
<?php
include_once 'connect.php';
session_start();
include_once 'logo.php';
?>
<link href="style.css" rel="stylesheet" type="text/css" />
<?php
if (isset($_SESSION['player']))
{
$player=$_SESSION['player'];
}
else
{
echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
exit;
}
$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>
<div id="table">
<?php
$counter = 0;
$class = $playerinfo3['pclass'];
$level = $playerinfo3['level'];
$pllocation=$playerinfo3['location'];
//////////////////////////new for video 18/////////////
$inninfo="SELECT * from locations where location='$pllocation' AND type='armorshop'";
$inninfo2=mysql_query($inninfo) or die("could not get player stats!");
$inninfo3=mysql_fetch_array($inninfo2);
if (isset($_GET['bought']))
{
$bypass = 1;
$id=$_GET['id'];
$playerid = $playerinfo3['id'];
$class = $playerinfo3['pclass'];
$level = $playerinfo3['level'];
$iteminfo="SELECT * from armor where id='$id'";
$iteminfo2=mysql_query($iteminfo) or die("could not get item stats!");
$iteminfo3=mysql_fetch_array($iteminfo2);
if ($playerinfo3['gold'] < $iteminfo3['price'])
{
echo "You do not have enough Gold for this purchase!";
echo "<center><a href='index.php'>Go Back</center>";
exit;
}
if ($playerinfo3['pclass'] != $iteminfo3['class'] && $iteminfo3['class'] != "any")
{
echo "You are not the right class for this item!";
echo "<center><a href='index.php'>Go Back</center>";
exit;
}
if ($playerinfo3['level'] < $iteminfo3['level'])
{
echo "You are not high enough level to use this item!";
echo "<center><a href='index.php'>Go Back</center>";
exit;
}
$name = $iteminfo3['name'];
$rating = $iteminfo3['rating'];
$wlevel = $iteminfo3['level'];
$location = $iteminfo3['location'];
$randid = rand(1000,999999999);
$percentage = $iteminfo3[price] / 100;
$price = $iteminfo3[price] * $percentage;
$newprice = $price + $iteminfo3[price];
$newprice = (int)$newprice;
$itembought = "INSERT into playerarmor(pid, name, rating, level, randid,price,class,location) VALUES ('$playerid','$name','$rating','$wlevel','$randid','$newprice','$class','$location')";
mysql_query($itembought) or die("could not insert weapon into backpack");
$updateplayer="update players set gold=gold-'$newprice' where name='$player'";
mysql_query($updateplayer) or die("Could not update player");
echo $name . " Purchased";
echo $inninfo3['exitgreet'] . "<br>";
echo "<a href='index.php'>Go Back</center>";
}
if ($bypass != 1)
{
echo "<center>" . $inninfo3['greeting'] . "<br>";
echo "<small>";
print "<center>";
print "<table border='0' width='70%' cellspacing='20'>";
print "<tr><td width='25%' valign='top'>";
print "</td>";
print "<td valign='top' width='75%'>";
$invinfo="SELECT * from armor where class = '$class' AND level <= '$level' || class='any'";
$invinfo2=mysql_query($invinfo) or die("could not select anything from the store.");
print "<table border='1' bordercolor='white' bgcolor='#ffffff'>";
print "<tr><td>Name<font color='ffffff'>________________</td><td>Rating<font color='ffffff'>______</td><td>Location<font color='ffffff'>______</td><td>Price<font color='ffffff'>______</td><td><font color='ffffff'>________________</td></tr>";
while($invinfo3=mysql_fetch_array($invinfo2))
{
$counter = 1;
/////////////////////new for video 18//////////////////////
$percentage = $inninfo3[price] / 100;
$price = $invinfo3[price] * $percentage;
$newprice = $price + $invinfo3[price];
$newprice = (int)$newprice;
print "<tr><td>$invinfo3[name]</td><td>$invinfo3[rating]</td><td>$invinfo3[location]</td><td>$newprice</td><td><A href='armorshop.php?id=$invinfo3[id]&bought=1'>Buy Armor</td></tr>";
}
print "</table>";
print "</td></tr></table>";
print "</center>";
echo "</small>";
if ($counter == 0)
{
echo "<center>There is nothing in the store at this time.<br>";
echo "<a href='index.php'>Go Back</center>";
exit;
}
echo "<center><a href='index.php'>NeverMind</center></a>";
}
?>
</div>
with weapon and armor shop, it just has an error for all items in the shop