so this is the code I have so far. I have a simple login system that works and sets a session that I use to match the same database field. The middle part s me just checking to see if I could pull info from the database. Now I'm stuck with trying to pull the quiz number from the row for the session that is logged in. thanks for any help.
Code:
<?php
include_once("config.php");
// Check user logged in already:
checkLoggedIn("yes");
doCSS();
print("Welcome to the members page <b>".$_SESSION["login"]."</b><br>\n");
print("<a href=\"logout.php"."\">Logout</a><br><br>");
$data = mysql_query("SELECT * FROM users")
or die(mysql_error());
$info = mysql_fetch_array( $data );
Print "<b>Name:</b> ".$info['login'] . " ";
Print "<b>Pass:</b> ".$info['password'] . " <br>";
if (isset($_SESSION[login])) {
$details = mysql_query("SELECT * FROM users WHERE login='".$_SESSION["login"]."'") or die ("Could not select info.<br>".mysql_error());
while ( $row = mysql_fetch_array($details) ) {
echo("Welcome " . $row['login'] . " from " . $row[quiznum] . "!");
}
echo $details;
}
?>
Bookmarks