Der sker bare ingenting
HejFølgende stykke kode burde returnere en bunke informationer om brugeren, men i stedet sker der bare intet. Dvs. at indholdet af headerfilen bliver loadet, men derefter står der intet.
Kode:
<? include('includes/header.inc.php');
//File: profile.php :: Info: Displays user profile
//Include LogFile
include('loginfo.php');
//Connect to MySQL DB
$db = mysql_connect("$mysql_host", "$mysql_user", "$mysql_pass") or die(mysql_error());
mysql_select_db($mysql_db, $db) or die(mysql_error());
//Get varibles
$user = $_GET['user'];
$accept = "FALSE";
//Check if user exists
$resultatset=mysql_query('SELECT user FROM 1y_brugere WHERE user=\''.mysql_escape_string($user).'\' LIMIT 1');
if(mysql_num_rows($resultatset)) {
list($user)=mysql_fetch_row($resultatset);
$accept = "TRUE";
$name = mysql_result(mysql_query("SELECT name FROM 1y_brugere WHERE user='$user'"),0) or die(mysql_error());
$user = mysql_result(mysql_query("SELECT user FROM 1y_brugere WHERE user='$user'"),0) or die(mysql_error());
$age = mysql_result(mysql_query("SELECT age FROM 1y_brugere WHERE user='$user'"),0) or die(mysql_error());
$gender = mysql_result(mysql_query("SELECT gender FROM 1y_brugere WHERE user='$user'"),0) or die(mysql_error());
$brace = mysql_result(mysql_query("SELECT brace FROM 1y_brugere WHERE user='$user'"),0) or die(mysql_error());
$post_forum = mysql_result(mysql_query("SELECT post_forum FROM 1y_brugere WHERE user='$user'"),0) or die(mysql_error());
$descrip = mysql_result(mysql_query("SELECT descrip FROM 1y_brugere WHERE user='$user'"),0) or die(mysql_error());
$descrip = nl2br($descrip);
print "<h1>Brugerprofil for ".$user."</h1>";
print "<p>Fulde Navn: ".$name."<br>";
print "<p>Alder: ".$age."<br>";
print "<p>Køn: ".$gender."<br>";
print "<p>Yndlings bæverrace: ".$brace."<br>";
print "<p>Forumindlæg: ".$post_forum."<br>";
print "<p>Beskrivelse:<br>".$descrip."<br>";
print "</p>";
} else {
print "<p>Brugeren findes ikke!";
print "<br><a href=\"userlist.php\">Tilbage</a></p>";
$accept = "FALSE";
};
?>
<? include('includes/footer.inc.php'); ?>
--
Der er indhold både i databasen og i footerfilen.
Nogle idéer?