Browser MMO Video #5

Location of the Videos
Post Reply
User avatar
Ravinos
Posts: 281
Joined: Tue Sep 15, 2009 4:14 pm

Re: Video#5

Post by Ravinos »

smashy wrote:fery helpfull tutorial....
i used the Login System v.2.0 that is PHP Login Script with Remember Me Feature you can get it here is free
http://evolt.org/files/Login_System_v.2.0.zip
maybe i will try to make it myself using your tutorials but in this script comes the admin center
Well I've started to follow these tutorials and everything is going amazing. I have finished video 13 and am quite impressed with what has been gone over so far. I look forward to more.

I like the idea of the more advanced login/user reg system included in the above quote but I am having serious issues with it. The pages formats do not seem to be coded correctly and are having display issues and showing bits of the code on the actual page. Does anyone have a fixed copy of this login system?
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#5

Post by hallsofvallhalla »

sorry i have not used it but I am sure someone here has a fix. I am very happy people are adding in their own scripts and code and sharing it.

Video 14 will be out tomorrow or maybe tonight. Thanks for watching

If you want to post the problems you are having with the script we might be able to help. Make a new topic though if you do that.
User avatar
templeguy
Posts: 34
Joined: Tue Sep 15, 2009 5:12 pm

Re: Video#5

Post by templeguy »

I am new in here :p
But i got a little "hint" here :p

First i typed this and i could not understand whats wrong!? :s

Code: Select all

<?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='battle.php'>Continue</a></big>";
}
else
{
	echo "<big>Wrong username or password. <A href='login.php'>Try Again</a></big>";
}
)
?>
But it was because i had no HD on so i could not see it but i change this:

{
echo "<big>Wrong username or password. <A href='login.php'>Try Again</a></big>";
}
) <---
?>

to this:

{
echo "<big>Wrong username or password. <A href='login.php'>Try Again</a></big>";
}
} <---
?>
Name: Mads
Age: 17
Contry: Denmark
Skill: Just Started
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#5

Post by hallsofvallhalla »

hello new guy, glad to have you

yes mistaking ) for } can definitely cause problems :)
User avatar
templeguy
Posts: 34
Joined: Tue Sep 15, 2009 5:12 pm

Re: Video#5

Post by templeguy »

Heya hallsofvallhalla :)
Thanks xD
Name: Mads
Age: 17
Contry: Denmark
Skill: Just Started
User avatar
Ravinos
Posts: 281
Joined: Tue Sep 15, 2009 4:14 pm

Re: Video#5

Post by Ravinos »

I've been busy the past couple of days but this again is in reference to the advanced login system posted by smashy at the beginning of the tutorial. I have included a link of what my main.php looks like when installed. I have gone through and installed the files as directed and set up the tables/db as shown.Here is the picture http://img188.imageshack.us/i/pagewjz.jpg/

Every page either spams the code as part of the page or as the whole page.The below code is the code for that page. The thing that gets to me is everyone else I talk to says it works flawlessly and yet I seem to get these errors.

Code: Select all

<?
/**
 * Main.php
 *
 * This is an example of the main page of a website. Here
 * users will be able to login. However, like on most sites
 * the login form doesn't just have to be on the main page,
 * but re-appear on subsequent pages, depending on whether
 * the user has logged in or not.
 *
 * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
 * Last Updated: August 26, 2004
 */
include("include/session.php");
?>

<html>
<title>Jpmaster77's Login Script</title>
<body>

<table>
<tr><td>


<?
/**
 * User has already logged in, so display relavent links, including
 * a link to the admin center if the user is an administrator.
 */
if($session->logged_in){
   echo "<h1>Logged In</h1>";
   echo "Welcome <b>$session->username</b>, you are logged in. <br><br>"
       ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>]   "
       ."[<a href=\"useredit.php\">Edit Account</a>]   ";
   if($session->isAdmin()){
      echo "[<a href=\"admin/admin.php\">Admin Center</a>]   ";
   }
   echo "[<a href=\"process.php\">Logout</a>]";
}
else{
?>

<h1>Login</h1>
<?
/**
 * User not logged in, display the login form.
 * If user has already tried to login, but errors were
 * found, display the total number of errors.
 * If errors occurred, they will be displayed.
 */
if($form->num_errors > 0){
   echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>";
}
?>
<form action="process.php" method="POST">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr>
<tr><td colspan="2" align="left"><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>>
<font size="2">Remember me next time     
<input type="hidden" name="sublogin" value="1">
<input type="submit" value="Login"></td></tr>
<tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr>
<tr><td colspan="2" align="left"><br>Not registered? <a href="register.php">Sign-Up!</a></td></tr>
</table>
</form>

<?
}

/**
 * Just a little page footer, tells how many registered members
 * there are, how many users currently logged in and viewing site,
 * and how many guests viewing site. Active users are displayed,
 * with link to their user information.
 */
echo "</td></tr><tr><td align=\"center\"><br><br>";
echo "<b>Member Total:</b> ".$database->getNumMembers()."<br>";
echo "There are $database->num_active_users registered members and ";
echo "$database->num_active_guests guests viewing the site.<br><br>";

include("include/view_active.php");

?>


</td></tr>
</table>


</body>
</html>
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#5

Post by hallsofvallhalla »

change the <? at the beginning of the php openings to <?php. that should fix it.
mrmajic
Posts: 117
Joined: Sat Jun 27, 2009 9:37 am

Re: Video#5

Post by mrmajic »

hiyas,

can someone xplain to me what this is -> as in

if($session->logged_in)

??
Mr Majic...

Current Project: http://www.deltarealm.net
feedback welcome.
siim
Posts: 6
Joined: Sat Oct 03, 2009 12:20 pm

Re: Video#5

Post by siim »

I have a problem whit killing. When i login whit my user...then its all good and shows the hpoints,attack and defense. But when i attack then :
(sorry about my bad english) can anybody help please ?

's Attack
's Attack roll is 20
dracula's defense roll is 24
misses!
dracula's Attack
dracula's Attack roll is 21
's defense roll is 1
dracula hits!
For 1 points of damage.
has been killed
Continue


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

Re: Video#5

Post by hallsofvallhalla »

hmm its not pulling the creatures information which means you need to check your get method. Look at the URL at top on the attack.php page and see what it says, see if its blank after creature= or if it matches the database.
Post Reply

Return to “Older Browser MMO Videos”