Page 27 of 35
Re: Video#5
Posted: Sun Feb 13, 2011 6:56 pm
by PaxBritannia
No problem. Just glad to be of help.
pax.
Re: Video#5
Posted: Sun Feb 20, 2011 9:20 pm
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!
Re: Video#5
Posted: Mon Feb 21, 2011 6:21 am
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.
Re: Video#5
Posted: Tue Feb 22, 2011 12:00 am
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.
Re: Video#5
Posted: Tue Feb 22, 2011 6:16 am
by PaxBritannia
Well there you have it.
Thanks no4h.
Let us know if it works out.
pax.
Re: Video#5
Posted: Tue May 10, 2011 12:45 am
by Klone
Um... I tried to make the login system, but for some reason, the authenticate.php page displays nothing at all
Re: Video#5
Posted: Tue May 10, 2011 1:53 am
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.
Re: Video#5
Posted: Sun May 15, 2011 5:26 am
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>";
}
}
?>
Re: Video#5
Posted: Sun May 15, 2011 3:04 pm
by hallsofvallhalla
your issue is here
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.
Re: Video#5
Posted: Sun May 15, 2011 4:53 pm
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>