Page 7 of 35

Re: Video#5

Posted: Mon Oct 19, 2009 5:00 pm
by herko125
yea i know ^^

Re: Video#5

Posted: Fri Nov 27, 2009 10:06 pm
by deluxxmanx
Hiya :)
Got this problem when trying to log in:
Parse error: parse error in D:\wamp\www\tutorial\authenticate.php on line 7
Here's my code :(

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($password);
  $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>";
  )
)
?>

Re: Video#5

Posted: Sat Nov 28, 2009 4:14 am
by Lord Strife
change your ( ) to { } in the if and else statements

Re: Video#5

Posted: Sat Nov 28, 2009 12:51 pm
by deluxxmanx
Could you please post me the whole, edited code? Thank you :)

Re: Video#5

Posted: Sat Nov 28, 2009 8:25 pm
by Falken
deluxxmanx wrote:Could you please post me the whole, edited code? Thank you :)
Oh come on, not a hard error. A simple PHP syntax error...
This is wrong:

Code: Select all

if (true)
(
echo "true";
)
This is right:

Code: Select all

if (true)
{
echo "true";
}
The differences are just () should be {} in the places showed above. If you gonna make a mmo you can't expect people will be fixing this kind of problem all the time so you just can copy & paste, you will learn a lot more by fixing it yourself after someone showed you!

Re: Video#5

Posted: Sat Nov 28, 2009 10:35 pm
by deluxxmanx
Thank you :)

Re: Video#5

Posted: Sun Nov 29, 2009 6:47 pm
by kingdk
Can someone please post the codes for this video. I tried to write them myself but was very confused. Or just email them to me kingdkknox@yahoo.com

thanks!

Re: Video#5

Posted: Wed Dec 02, 2009 3:43 am
by princezane
I don't have the code for this anymore as these files get updated in the next video, where are you having a problem maybe we can help you out. Post any errors you're getting along with the code and we'll see what we can do :)

Re: Video#5

Posted: Wed Dec 02, 2009 2:10 pm
by hallsofvallhalla
yes post the errors but i recommend everyone continue with the videos till you get to some source. There is no point in trying to type all this out now. Just watch the videos and learn.

Re: Video#5

Posted: Fri Dec 11, 2009 7:27 am
by phq
Hi,
how come when I try to login my password doesn't work I have to enter
c112ca8d2922bcaac5c64b666dc0fae0 instead of my normal pass.