Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
<?php
//This page display the profile of an user
include('config.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<link href="<?php echo $design; ?>/style.css" rel="stylesheet" title="Style" />
<title>Profile of an user</title>
</head>
<body>
<div align="center">
<div class="header" style="margin: auto;width: 100%;margin-top: 10px">
<a href="<?php echo $url_home; ?>"><img width="80%" src="<?php echo $design; ?>/images/logo.png" alt="Forum" /></a>
</div></div><!--
<div class="contentprofile"> -->
<div class="contentusers">
<?php
if(isset($_SESSION['username']))
{
$nb_new_pm = mysqli_fetch_array(mysqli_query($var,'select count(*) as nb_new_pm from pm where ((user1="'.$_SESSION['userid'].'" and user1read="no") or (user2="'.$_SESSION['userid'].'" and user2read="no")) and id2="1"'));
$nb_new_pm = $nb_new_pm['nb_new_pm'];
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">WCSF Index</a> &gt; Profile of an user
</div>
<div class="box_right">
<a href="list_pm.php">Your messages(<?php echo $nb_new_pm; ?>)</a> - <a href="profile.php?id=<?php echo $_SESSION['userid']; ?>"><?php echo htmlentities($_SESSION['username'], ENT_QUOTES, 'UTF-8'); ?></a> (<a href="login.php">Logout</a>)
</div>
<div class="clean"></div>
</div>
<?php
}
else
{
?>
<div class="box">
<div class="box_left">
<a href="<?php echo $url_home; ?>">WCSF Index</a> &gt; Profile of an user
</div>
<div class="box_right">
<a href="signup.php">Sign Up</a> - <a href="login.php">Login</a>
</div>
<div class="clean"></div>
</div>
<?php
}
if(isset($_GET['id']))
{
$id = intval($_GET['id']);
$dn = mysqli_query($var,'select username, email, user_address, signup_date from users where id="'.$id.'"');
if(mysqli_num_rows($dn)>0)
{
$dnn = mysqli_fetch_array($dn);
?>
This is the profile of "<?php echo htmlentities($dnn['username']); ?>" :
<?php
if($_SESSION['userid']==$id)
{
?>
<br /><div class="center"><a href="edit_profile.php" class="button">Edit my profile</a></div>
<?php
}
?>
<table style="width:500px;">
<tr>
<td><?php
if($dnn['user_address']!='')
{
echo '<img src="'.htmlentities($dnn['user_address'], ENT_QUOTES, 'UTF-8').'" alt="" style="max-width:10px;max-height:10px;" />';
}
else
{
echo '';
}
?></td>
<td class="left"><h1><?php echo htmlentities($dnn['username'], ENT_QUOTES, 'UTF-8'); ?></h1></td>
<td class="left">User Address:<?php echo htmlentities($dnn['user_address'], ENT_QUOTES, 'UTF-8'); ?></br>
Email: <?php echo htmlentities($dnn['email'], ENT_QUOTES, 'UTF-8'); ?><br />
This user joined the website on <?php echo date('Y/m/d',$dnn['signup_date']); ?></td>
</tr>
</table>
<?php
if(isset($_SESSION['username']) and $_SESSION['username']!=$dnn['username'])
{
?>
<br /><a href="new_pm.php?recip=<?php echo urlencode($dnn['username']); ?>" class="big"> Send a PM to"<?php echo htmlentities($dnn['username'], ENT_QUOTES, 'UTF-8'); ?>"</a>
<?php
}
}
else
{
echo 'This user doesn\'t exist.';
}
}
else
{
header("location:login.php?msg=Login First to use service"); //zubair
}
?>
</div>
<!-- <div class="foot">
<p><b>Water Control System and Discussion Portal for Farmers</b></p>
</div> -->
</body>
</html>