I was trying to copy Hall's code from video 5 because he didn't post the source, and it was a bit blurry and I ended up getting a lot of errors.
Errors;
Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\tutorial\authenticate.php on line 8
Parse error: syntax error, unexpected ';' in C:\wamp\www\tutorial\authenticate.php on line 7
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'";
$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>";
)
)
?>Sincerely,
Zorber.