<?php
session_start();
require_once("connect.php");
// Check his status.
if (!empty($_SESSION[username])) // he got it.
{
echo "You are currently logged in as <b>$_SESSION[username]</b>.<br>";
echo "Your Pre-Alpha rank is:";
}
else // bad info.
{
echo "You are currently <b>NOT</b> logged in.";
}
?>
<?php
session_start();
// Check if he wants to login:
if (!empty($_POST[username]))
{
require_once("connect.php");
// Check if he has the right info.
$query = mysql_query("SELECT * FROM members
WHERE username = '$_POST[username]'
AND password = '$_POST[password]'")
or die ("Error - Login failed.");
$row = mysql_fetch_array($query)
or die ("Error - Login failed.");
if (!empty($row[username])) // he got it.
{
$_SESSION[username] = $row[username];
echo "Welcome $_POST[username]! You've been successfully logged in.<br>";
echo "right now the UCP is being worked on but you are on the system.<br>";
exit();
}
else // bad info.
{
echo "Error - Login failed.<br /><br />
Please try again.";
exit();
}
}
?>
PHP:$dbquery = mysql_query("SELECT rank FROM ranktable WHERE username=""$SESSION['username']");
I think.Code:rank is: <?php echo $dbquery ?>
Yeah, this.change
$dbquery = mysql_query("SELECT rank FROM ranktable WHERE username=""$SESSION['username']");
with
$dbquery = mysql_result("SELECT rank FROM ranktable WHERE username=""$SESSION['username']");
What is it showing?Nope didnt work
Fix the quotes.Parse error: syntax error, unexpected '"' in /home/u739026383/public_html/members.php on line 67
How? Whats ment to go there? :L im not good with phpFix the quotes.