Code: Select all
$query="select name,password from players where name= '$player' and '$password'";
Code: Select all
$query="select name,password from players where name= '$player' and password='$password'";
Code: Select all
$query="select name,password from players where name= '$player' and '$password'";
Code: Select all
$query="select name,password from players where name= '$player' and password='$password'";
hallsofvallhalla wrote:I stopped posting source for videos under 10. It is easier for everyone to watch at least to 10, I recommend watching until 14 or so then work with the code. Has nothing to do with learning abilities or anything, just easier to watch the early videos.
Code: Select all
<?php
include 'connect.php';
session_start();
if (isset($SESSION['player']))
(
$player=$_SESSION['player'];
)
else
(
echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
exit;
)
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
$playerhp = $playerinfo3['hpoints'];
$playerattack = $playerinfo3['attack'];
$playerdefense = $playerinfo3['defense'];
Code: Select all
<?php
include 'connect.php';
session_start();
if (isset($_SESSION['player'])) //looks like you need to add the underscore here, too
{ //change to bracket. Parenthesis don't work here.
$player=$_SESSION['player'];
} else
{
echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
exit;
}
$playerinfo="SELECT * from players where name='$player'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
$playerhp = $playerinfo3['hpoints'];
$playerattack = $playerinfo3['attack'];
$playerdefense = $playerinfo3['defense'];
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>";
)
)
?>
Code: Select all
<?php
include 'connect.php';
session_start();
if (isset($SESSION['player']))
(
$player1=$_SESSION['player1'];
)
else
(
echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
exit;
)
$playerinfo="SELECT * from players where name='player1'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
if (isset($_GET['creature']))
{
$creature=$_GET['creature'];
$creatureinfo="SELECT * from creatures where name = '$creature'";
$creatureinfo2=mysql_query($creatureinfo) or die("could not get the creature you were fighting!");
$creatureinfo3=mysql_fetch_array($creatureinfo2);
Code: Select all
<?php
include 'connect.php';
session_start();
if (isset($SESSION['player']))
(
$player1=$_SESSION['player1'];
)
else
(
echo "Not Logged in <br><br> <A href='login.php'>Login</a>";
exit;
)
$playerinfo="SELECT * from players where name='player1'";
$playerinfo2=mysql_query($playerinfo) or die("could not get player stats!");
$playerinfo3=mysql_fetch_array($playerinfo2);
$playerhp = $playerinfo3['htpoints'];
$playerattack = $playerinfo3['attack'];
$playerdefense = $playerinfo3['defense'];
Code: Select all
if ($this == $that)
{
}