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 »

your missing a ;

Code: Select all

   $password=md5($password)
should be

Code: Select all

   $password=md5($password);
faceless
Posts: 8
Joined: Tue Aug 10, 2010 12:58 am

Re: Video#5

Post by faceless »

Cheers! - works! - now it goes blank though, but i saw a guy with similar problem way back. Gonna look at that :)
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#5

Post by hallsofvallhalla »

change this

Code: Select all

if (isset($_POST['Submit']))
to

Code: Select all

if (isset($_POST['submit']))
faceless
Posts: 8
Joined: Tue Aug 10, 2010 12:58 am

Re: Video#5

Post by faceless »

Everything works now -

You have my gratitude halls :) - <3


if you need some 3D models, give me a shout ;D least i can do.
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#5

Post by hallsofvallhalla »

thanks!
User avatar
Justeenoman
Posts: 16
Joined: Sun Aug 22, 2010 2:21 pm

Re: Video#5

Post by Justeenoman »

HallsofVallhalla, you are amazing. I have been following your tutorials to create my own game, I did make seperate creatures though. Anyways, I came across a problem in my code, and cannot figure the dang thing out. I read earlier in the comments, about a "Parse error: parse error in C:\wamp\www\tutorial\authenticate.php on line 7"...

Here is my login.php:

Code: Select all

<form method="POST" action="authenticate.php">
Username <input type="text" name="player" size="21"><br>
Password <input type="password" name="password" size="21">
<br>
<input type="submit" value="Login" name="submit">
and here is my authenticate.php:

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='$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>";
}
}
else
{
echo "no submit post variable set";
}
?>
Please help...
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video#5

Post by hallsofvallhalla »

you have a ( instead of a {

directly after if statements you use ( ) but below the if statements as code blocks you use { }
User avatar
Justeenoman
Posts: 16
Joined: Sun Aug 22, 2010 2:21 pm

Re: Video#5

Post by Justeenoman »

Hahah, wow..... Thank you. I did have to read it from the video, and my eyesight is going down the drain. Thank you again.
r4t
Posts: 4
Joined: Fri Oct 01, 2010 1:26 pm

Re: Video#5

Post by r4t »

can you write down the code of authenticate.php because i got problems with (), {} and [] because i dont see them in 720p ( the best graphic)
darspire
Posts: 194
Joined: Sat Jul 25, 2009 9:21 pm

Re: Video#5

Post by darspire »

since i havent had a problem with my authenticate.php, ill post it for you. do with it what you will. :)

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 "<center><big>Logged in successfully</center><br>";
    echo "<center><A href='index.php'>Continue</a></big></center>";
  }
  else
  {
   echo "<big>Wrong username or password.<A href='login.php'>Try Again</a></big>";
  }
}
?>
if you love something, let it go.
if it doesnt return.....hunt it down and kill it.
Post Reply

Return to “Older Browser MMO Videos”