Browser MMO Video #5
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video#5
You need to change the ( ) to { } like in the last script. In it's current state, there is no telling what the script may do.
The indelible lord of tl;dr
Re: Video#5
Yah i noticed that and fixed it but it still doesn't work. There hast to be something wrong with authenticate.php but i can't tell what, i don't have HD so i have a hard time reading the video but nothing really stands out wrong with my script anymore. White space isn't counted right?
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#5
$_post should be $_POST
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video#5
Still not sure why that would cause a blank screen. That should be a parse error, unknown function name, or an undefined variable. I think there is something else that is being missed here.hallsofvallhalla wrote:$_post should be $_POST
@Dizuki:
Can you tell us exactly what happens when you reach the blank screen. What page you were on, what you clicked, and what the address bar says you are on when the page is blank.
The indelible lord of tl;dr
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Video#5
the reason why is because it is treating $_post as a array variable. If that variable is empty, the submit, then there is no error and the the page does not have a if player does not hit submit.
change the bottom of your page to look like this
and you will get that error because no submit is happening. Let me also see your login page.
change the bottom of your page to look like this
Code: Select all
else
{
echo "<big>Wrong username or password. <a href='login.php'>Try Again</a></big>";
}
}
else
{
echo "no submit post variable set";
}
?>
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video#5
Oops! Missed that one, and then I was looking at the second posted script.
The indelible lord of tl;dr
Re: Video#5
Ok now it says "no submit post variable set" like halls said it would.
Here is login.php :
Here is login.php :
Code: Select all
<form method="post" action="authenticate.php">
User Name <input type="text" name="player" size="21">
Password <input type="password" name="password" size="21" mask="x">
<br>
<input type="submit" value="Login" name="Submit">
<br>
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video#5
Did you capitalize the $_POST and remove the space after it? It should be:
Code: Select all
$_POST['submit']
The indelible lord of tl;dr
Re: Video#5
Ok its becoming pretty obvious that i suck at this. LOL Ok so what else do i capitalize?
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video#5
Anytime you store variables with $_POST, $_GET, $_SESSION, or $_COOKIE you need to capitalize them because PHP is case-sensitive. That means that even your own variables are case sensitive.
If you are feeling lost, you will get much more out of the tutorials if you read a book on PHP beforehand. Then you are only using the techniques in the tutorial, rather than just typing it verbatim without knowing how it works. Here is a good and free online book you can check out. Read as much as you like, but you should seriously consider reading chapters 1 - 10, 17, 18 and 19. After that you should have a full understanding of the PHP being used to make web games.
If you are feeling lost, you will get much more out of the tutorials if you read a book on PHP beforehand. Then you are only using the techniques in the tutorial, rather than just typing it verbatim without knowing how it works. Here is a good and free online book you can check out. Read as much as you like, but you should seriously consider reading chapters 1 - 10, 17, 18 and 19. After that you should have a full understanding of the PHP being used to make web games.
The indelible lord of tl;dr