Re: Video#10
Posted: Thu Nov 12, 2009 8:07 pm
you have to copy them of the screen or ask me to give them to you...
This is what I decided to do after vid 11...I was going to fast; I wanted to get a simple game running (I don't know why, though). I ended up getting lostJackolantern wrote:I would suggest that instead of wanting to get to the next video as soon as possible, it is a good idea for people to experiment with what was just shown in the current video. This way, you will be much better prepared for modding the game to make it your own. Try to link existing systems, upgrade what was just shown to add new features (share them if you make a nice update!), and on and on. Each video could probably offer hours of experimenting to make sure you comprehend the PHP being shown (for new PHPers), or the design concepts (for experienced PHPers, but those new to PHP MMO development).
Exactly. "Messing around with it" is the operative phrase there. "Getting ahead" of the videos will only cause confusion if you aren't already a seasoned PHP coder.Zerk wrote:This is what I decided to do after vid 11...I was going to fast; I wanted to get a simple game running (I don't know why, though). I ended up getting lostJackolantern wrote:I would suggest that instead of wanting to get to the next video as soon as possible, it is a good idea for people to experiment with what was just shown in the current video. This way, you will be much better prepared for modding the game to make it your own. Try to link existing systems, upgrade what was just shown to add new features (share them if you make a nice update!), and on and on. Each video could probably offer hours of experimenting to make sure you comprehend the PHP being shown (for new PHPers), or the design concepts (for experienced PHPers, but those new to PHP MMO development).![]()
Went back and did vids 3-10 SLOWLY and messed around with it.^^ lol
Code: Select all
<?php
include_once 'connect.php';
session_start();
///new for video 8/////////////
include_once 'logo.php';
?>
<link href="style.css" rel="stylesheet" type="text/css" />
<div id="login2" div align="center">
<?php
///////////////////////////////////
if (isset($_SESSION['player']))
{
$player=$_SESSION['player'];
}
else
{
echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
exit;
}
$randid=$_GET['randid'];
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
$playerid = $playerinfo3['id'];
$iteminfo="SELECT * from store where randid='$randid'";
$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;
)
$name = $iteminfo3['name'];
$stats = $iteminfo3['stats'];
$statadd = $iteminfo3['statadd'];
$type = $iteminfo3['type'];
$randid2 = rand(1000,999999999);
$itembought = "INSERT into inventory(id, name, stats, statadd, randid,type) VALUES ('$playerid','$name','$stats','$statadd','$randid2','$type')";
mysql_query($itembought) or die("could not insert item into backpack");
$updateplayer="update players set gold=gold-='$iteminfo3[price]' where name='$player'";
mysql_query($updateplayer) or die("Could not update player");
echo $name . " Purchased";
echo "<center><a href='index.php'>Go Back</center>";
////did not make a - counter for item////
?>
Code: Select all
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;
}