Profile Page

Screen Shot 2015-04-20 at 09.40.41

For the profile page we created quite a simplistic look. It featured all the details a user would want displayed as well as an avatar in which the user could upload a photo. Unfortunately, we could not get the upload system to work although it had been coded the system was not working. As well as this, when the user logs into the sight they are directed straight to their profile page which also comes up with a “Success” message in green to confirm they have managed to gain entry into the sight.

</pre>
<?php

$userID = $_SESSION["user_id"];
$query = "SELECT * FROM users WHERE id = '{$userID}' ";
$result = mysqli_query($connection, $query);



?>





?>

<div class="container">

<div class="row row-offcanvas row-offcanvas-right">

<div class="col-xs-12 col-sm-9">
<p class="pull-right visible-xs"></p>
<div class="jumbotron">

<img id="avatar"src="http://localhost/~tessa/project/public/images/avatar" style="width:450px; height:450px">
<h1>Hello


To get the information into the profile the data is taken from PHPmyAdmin and then echoed out the information they entered when registering with the site.

</pre>
<?php

$userID = $_SESSION["user_id"];
$query = "SELECT * FROM users WHERE id = '{$userID}' ";
$result = mysqli_query($connection, $query);
?>


<?php while($row = mysqli_fetch_assoc($result)) { ?>
<?php echo $row["firstname"]; ?></h1>

<p>Username: <?php echo $row["username"]; ?></p>
<p>First Name: <?php echo $row["firstname"]; ?></p>
<p>Last Name: <?php echo $row["lastname"]; ?></p>
<p>Age: <?php echo $row["age"]; ?></p>
<p>Hair: <?php echo $row["hair"]; ?></p>
<p>Gender: <?php echo $row["gender"]; ?></p>
<p>Biography: <?php echo $row["biography"]; ?></p>
<p>University Course: <?php echo $row["uni"];?></p>

<?php } ?>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s