Browser MMO Video #5

Location of the Videos
User avatar
PaxBritannia
Posts: 680
Joined: Sun Apr 18, 2010 1:54 pm

Re: Video#5

Post by PaxBritannia »

No problem. Just glad to be of help. :)

pax.
Watcher
Posts: 6
Joined: Thu Feb 17, 2011 2:55 am

Re: Video#5

Post by Watcher »

I am just starting this, everything has been fine till now, after I log in I get the goblin stats but none for the player just shows this.

Hit points =
Attack =
Defense =


Goblin
Hit points = 5
Attack = 3
Defense = 3


Attack!
User avatar
PaxBritannia
Posts: 680
Joined: Sun Apr 18, 2010 1:54 pm

Re: Video#5

Post by PaxBritannia »

Hi Watcher!

Welcome to indie-resource. :)

As for the problem, I'm sorry, but I can't do much to help you without any code to work with.

Although it sounds like a database data issue, could you post the code onto here?


pax.
n04h
Posts: 151
Joined: Thu Feb 10, 2011 4:48 am

Re: Video#5

Post by n04h »

The reason is, that you do not have your characters info put in. Go into your DB and find your players tab than find the character you want to add stats for and click insert and add all the stats for that player. Hope that helped.
Last edited by n04h on Tue Feb 22, 2011 3:41 pm, edited 1 time in total.
Image
User avatar
PaxBritannia
Posts: 680
Joined: Sun Apr 18, 2010 1:54 pm

Re: Video#5

Post by PaxBritannia »

Well there you have it.

Thanks no4h. :D

Let us know if it works out. :)

pax.
Klone
Posts: 3
Joined: Tue May 10, 2011 12:44 am

Re: Video#5

Post by Klone »

Um... I tried to make the login system, but for some reason, the authenticate.php page displays nothing at all
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#5

Post by hallsofvallhalla »

strange, post your code here, though if I was you I would keep watching the videos as it may fix itself on its own.
aim
Posts: 10
Joined: Sun May 15, 2011 5:22 am

Re: Video#5

Post by aim »

My authenticate.php code is as listed below, but when I try to login at localhost/tutorial/login.php I get this...
( ! ) Notice: Undefined index: password in C:\wamp\www\Tutorial\authenticate.php on line 8
Call Stack
# Time Memory Function Location
1 0.0017 681496 {main}( ) ..\authenticate.php:0
Wrong username or password.Try Again

I made a new account with a password just to make sure it was correct, but still no luck.


<?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='$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='battle.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 »

your issue is here

Code: Select all

$password=$_POST['password'];
nothing is being passed to it from register.php
check your register.php and make sure your form's password field is spelled right.


i recommend watching all the videos up to around 14 before attempting any code.
aim
Posts: 10
Joined: Sun May 15, 2011 5:22 am

Re: Video#5

Post by aim »

Here is my register.php. I don't see anything wrong, but maybe im just missing it.

<?php
include 'connect.php';

?>

<form method="post" action="reguser.php">
Type Username Here: <input type="text" name="player" size="21"><br>
Type Password Here: <input type="text" name="password" size="15"><br>
Retype password: <input type="text" name="pass2" size="15"><br>
Type E-mail address: <input type="text" name="email" size="60"><br>
<input type="submit" value="submit">
</form>
Post Reply

Return to “Older Browser MMO Videos”