Browser MMO Video #5
Re: Video#5
Will you please post the source code to the login.php and the other file forgot the name right now.
Re: Video#5
Will you please post the source code for both files
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video#5
All of the scripts are posted. I think login and reguser are listed under the video file in the thread for Video 3.
The indelible lord of tl;dr
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#5
i strongly recommend you watch teh videos all the way to video 14 at least then work with the code.
Re: Video#5
I'm having some problems with the 5# video
here is the code
authenticate.php
I'm having a parse on line 7
can you please post the code?
I couldn't find it.
here is the code
authenticate.php
Code: Select all
<?php
include_once "coonetct.php";
session_start();
if (isset($_POST['submit']))
(
$player=$_POST['player'];
$password=$_POST['password'];
$player=strip_tags($player);
$player=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>";
)
)
?>
can you please post the code?
I couldn't find it.
Re: Video#5
A couple of things - not sure if they are your problem or not
include_once "coonetct.php"; <-- should probably be "connect.php"
Change: $query="select name,password from players where name= '$player' and '$password'";
to: $query="select name,password from players where name= '$player' and password='$password'";
include_once "coonetct.php"; <-- should probably be "connect.php"
Change: $query="select name,password from players where name= '$player' and '$password'";
to: $query="select name,password from players where name= '$player' and password='$password'";
Re: Video#5
why are you using () braces in your initial if statement? it seems to be more confusing to read.
I am not sure if php interprets it any different then curly braces but curly braces allow for you to keep your code clean and know where statements end and begin with less confusion.
Code: Select all
if (foo)
(
echo "foo";
)
Code: Select all
if (foo)
{
echo "foo";
}
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#5
it will error out of you try to use (
)
use {
}
)
use {
}
Re: Video#5
Thanks for clarifying that halls.
Re: Video#5
keep getting could not query players can someone help??? 
