Browser MMO Video #5

Location of the Videos
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#5

Post by hallsofvallhalla »

ah i think i see the problem, post your login.php
godfather
Posts: 8
Joined: Mon Aug 31, 2009 10:52 pm

Re: Video#5

Post by godfather »

<form method="POST" action="authenticate.php">
User Name <input type="text" name="players" size="21"><br>
Password <input type="password" name="passowrd" size="21" mask="x">
<br>
<input type="submit" value="Login" name="submit">
godfather
Posts: 8
Joined: Mon Aug 31, 2009 10:52 pm

Re: Video#5

Post by godfather »

lol...done

thnks

but now i have another problem
in the store table and the inventory table...i cant go to browse
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#5

Post by hallsofvallhalla »

so you seen the mistake, the passowrd :)



thats because there is nothing there, you need to go to insert and insert data
godfather
Posts: 8
Joined: Mon Aug 31, 2009 10:52 pm

Re: Video#5

Post by godfather »

yes :)
noahqw
Posts: 8
Joined: Fri Sep 04, 2009 9:48 pm

Re: Video#5 HELP ME

Post by noahqw »

help me! I need the authenticate code... Mine has errors an said this over and over when i tried to login: Parse error: parse error in C:\wamp\www\game\authenticate.php on line 7
Somone please give me the authenticate code!
dave3460
Posts: 117
Joined: Wed Jul 01, 2009 2:13 pm

Re: Video#5

Post by dave3460 »

Also sent it via pm if you needed


<?php
include_once 'connect.php';
session_start();

if (isset($_POST['submit']))
{
$player=$_POST['player'];
$password=$_POST['password'];
$player=strip_tags($player);
$password=strip_tags($password);
$password=md5($password);

$query = "select name,password from players where name='$player' and '$password'";
$result = mysql_query($query) or die("Could not query players");
$result2 = mysql_fetch_array($result);
if ($result2)
{
$_SESSION['player']=$player;

echo "<big>Logged in successfully<br>";
echo "<A href='index.php'>Continue</a></big>";
}
else
{
echo "<big>Wrong username or password.<A href='login.php'>Try Again</a></big>";
}
}
?>
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#5

Post by hallsofvallhalla »

if you are still having errors show us your players table and your code.
noahqw
Posts: 8
Joined: Fri Sep 04, 2009 9:48 pm

Re: Video#5

Post by noahqw »

Somone please help me... I get a error saying the following below when I go to the battle.php screen...
error: Parse error: parse error in C:\wamp\www\game\battle.php on line 7

battle.php code:
<?php
include_once 'connect.php';
session_start();

if (isset($_SESSION['player']))
(
$player=$_SESSION['player'];
)


$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);

$playerhp = $playerinfo3['hpoints'];
$playerattack = $playerinfo3['attack'];
$playerdefense = $playerinfo3['defense'];

if (isset($_GET['creature']))
{
$creature=$_GET['creature'];
$creatureinfo="SELECT * from creatures where name = '$creature'";
$creatureinfo2=mysql_query($creatureinfo) or die("could not get the creature you were fighting!");
$creatureinfo3=mysql_fetch_array($creatureinfo2);

}
else
{
$creatureinfo="SELECT * from creatures order by rand() limit 1";
$creatureinfo2=mysql_query($creatureinfo) or die("could get a creature!");
$creatureinfo3=mysql_fetch_array($creatureinfo2);
}

$creature = $creatureinfo3['name'];
$creaturehp = $creatureinfo3['hpoints'];
$creatureattack = $creatureinfo3['attack'];
$creaturedefense = $creatureinfo3['defense'];

/////player info
echo "<u> " . $playerinfo3['name'] . "</u><br>";
echo "Hit points = " . $playerhp . "<br>";
echo "Attack = " . $playerattack . "<br>";
echo "Defense = " . $playerdefense . "<br><br><br>";

///////creature info
echo "<u> " . $creatureinfo3['name'] . "</u><br>";
echo "Hit points = " . $creaturehp . "<br>";
echo "Attack = " . $creatureattack . "<br>";
echo "Defense = " . $creaturedefense . "<br><br><br>";

echo "<a href='attack.php?creature=$creature'>Attack!";

?>
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#5

Post by hallsofvallhalla »

Code: Select all

if (isset($_SESSION['player']))
(
$player=$_SESSION['player'];
)
should be

Code: Select all

if (isset($_SESSION['player']))
{
$player=$_SESSION['player'];
}
Post Reply

Return to “Older Browser MMO Videos”