Created
March 27, 2014 23:40
-
-
Save trq/9821666 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php include 'login-register-header.php'; ?> | |
<h2>Your Profile</h2> | |
<p>Have your say, choose your avatar and more.</p> | |
<h3>Your Avatar</h3> | |
<?php | |
require 'connect.php'; | |
var_dump($_SESSION['user']); | |
// Outputs the avatar based on the SQL entry | |
if(!empty($_SESSION['user'])){ | |
$result = mysql_query("SELECT avatar FROM `users` WHERE `username` = '{$_SESSION['user']}'") or die(mysql_error()); | |
if ($result && mysql_num_rows($query)){ | |
$row = mysql_fetch_assoc($result); | |
echo $row['avatar'] . ".jpg"; | |
} | |
} else { | |
echo "You are not logged in!"; | |
} | |
?> | |
<?php include 'login-register-footer.php'; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment