hya can someone take a look at this coding its for view profile and it has a on/offline on it when i log in it shows offline and nothing echos through see pic
<?php
include("config/db_connect.php");
$profid = $_GET['profid'];
// code for user details
$query = mysql_query("select * from user where user_id = '".$profid."' ");
$fetch_user = mysql_fetch_array($query);
$user_image = mysql_query("select * from user_images where user_id ='".$fetch_user['user_id']."' and main_image = '1' ");
$fetch_image= mysql_fetch_array($user_image);
if($_GET['gen']!= "")
{
$_SESSION['user_gender'] = $_GET['gen'];
}
$info_query = mysql_query("select * from user_info where user_id = '".$fetch_user['user_id']."' ");
$fetch_info = mysql_fetch_array($info_query);
//code start here for last visit to see profile
if($_SESSION['userid']!='')
{
if($_SESSION['userid']!="$profid")
{
$check_visit = mysql_query("select * from visitor where visitor_id = '".$_SESSION['userid']."' and user_id = '".$profid."' ");
if(mysql_num_rows($check_visit)>0)
{
mysql_query("update visitor set visit_date=now() where user_id='".$profid."'and visitor_id='".$_SESSION['userid']."'");
}else {
mysql_query("insert into visitor set user_id = '".$profid."' , visitor_id = '".$_SESSION['userid']."' , visit_date = now() , status = '1' ");
}
}
}
//code end here for last visit to see profile
?>
<html>
<head>
<title>View Profile</title>
<script type="text/javascript">
function del_prompt(form1,comb)
{
if(comb=='favorite'){
form1.action = "favorites.php";
form1.submit();
}
else if(comb=='Active'){
form1.action = "gallery-active.php";
form1.submit();
}
}
</script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="stickytooltip.js"></script>
<link rel="stylesheet" type="text/css" href="stickytooltip.css" />
<script type="text/javascript">
$(document).ready(function(){
$("Div#arrowdon").click(function(){
$("Div#proinfod").removeClass('pro_div');
$("Div#proinfod").addClass('pro_divdown');
//$("Div#proinfod").animate({height:-520},"slow");
});
$("Div#arrowup").click(function(){
$("Div#proinfod").removeClass('pro_divdown');
$("Div#proinfod").addClass('pro_div');
//$("Div#proinfod").animate({height:520},"slow");
});
});
</script>
</head>
<body>
<?php
// Fetch user randam for display on top
$query_rand = mysql_query("select * from user where user_id!='".$profid."' and user_gender ='".$_SESSION['user_gender']."' ORDER BY RAND() LIMIT 0,7"); ?>
<?php while($query_rand_row = mysql_fetch_array($query_rand)) {
$user_imagerd = mysql_fetch_array(mysql_query("select * from user_images where user_id = '".$query_rand_row['user_id']."' and main_image = '1' "));
?>
<?php if($user_imagerd['user_image']!='') { ?>
<a href="viewprofile.php?profid=<?php echo $query_rand_row['user_id'];?>"><img src="images/user_images/smallthumb/<?php echo $user_imagerd['user_image'];?>" border="0" width="90" height="90"/></a>
<?php } else { ?>
<a href="viewprofile.php?profid=<?php echo $query_rand_row['user_id'];?>"><img src="images/blank.jpg" border="0" width="90" height="90" /></a>
<?php } ?>
<?php } ?>
<?php if($fetch_image['user_image']!='') {?>
<img src="images/user_images/<?php echo $fetch_image['user_image'];?>" border="0" />
<?php } else { ?>
<img src="images/blank_big.jpg" height="90px;" width="90px;" />
<?php } ?>
<?php
$lastlogin = mysql_fetch_array(mysql_query("select * from user_lastlogin where user_id = '".$profid."' "));
$onstatus = $lastlogin['online_status'];
?>
<?php if($onstatus=='1') { echo "Online"; } else { echo "Offline"; } ?>
<table width="400" border="0">
<tbody>
<tr>
<td><label for="username">username:</label><?php echo $fetch_user['user_name'];?></td>
</tr>
<tr>
<td><label for="username">location:</label><?php echo $fetch_info['city'];?></td>
</tr>
<tr>
<td><label for="username">gender:</label><?php echo $fetch_user['user_gender'];?></td>
</tr>
<tr>
<td><label for="username">age:</label><?php echo $fetch_user['age'];?></td>
</tr>
<tr>
<td><label for="username">status:</label><?php echo $fetch_info['marital_status'];?></td>
</tr>
<tr>
<td><label for="username">hair color:</label><?php echo $fetch_info['hair'];?></td>
</tr>
<tr>
<td><label for="username">eye color:</label><?php echo $fetch_info['eyecolor'];?></td>
</tr>
<tr>
<td><label for="username">height:</label><?php echo $fetch_info['height'];?>
cm ( <?php echo get_height($fetch_info['height'])?> )</td>
</tr>
<tr>
<td><label for="username">best feature:</label><?php echo stripslashes($fetch_info['best_describes']);?></td>
</tr>
<tr>
<td><label for="username">occupation:</label><?php echo stripslashes($fetch_info['your_profession']);?></td>
</tr>
<tr>
<td><label for="username">drinks:</label><?php echo $fetch_info['drink'];?></td>
</tr>
<tr>
<td><label for="username">drugs:</label><?php echo $fetch_info['drugs'];?></td>
</tr>
<tr>
<td><label for="username">smoke:</label><?php echo $fetch_info['smoke'];?></td>
</tr>
<tr>
<td><label for="username">education:</label><?php echo $fetch_info['education'];?></td>
</tr>
<tr>
<td><label for="username">body type:</label><?php echo $fetch_info['bodytype'];?></td>
</tr>
<tr>
<td><label for="username">religion:</label><?php echo $fetch_info['religion'];?></td>
</tr>
<tr>
<td><label for="username">ethnicity:</label><?php echo $fetch_user['user_ethnicity'];?></td>
</tr>
<tr>
<td><label for="username">Last Online:</label><?php echo ($lastlogin['lastlogin']);?></td>
</tr>
<tr>
<td><label for="username">Member Since:</label><?php echo $fetch_user['reg_date'];?></td>
</tr>
<tr>
<td><img src="images/arrow1.jpg" border="0" /></td>
</tr>
<tr>
<td><img src="images/arrow2.jpg" border="0" /></td>
</tr>
</tbody>
</table>
<?php
$sql_slide = mysql_query("select * from user_images where user_id = '".$fetch_user['user_id']."' and show_profile = '1' ");
if(mysql_num_rows($sql_slide)>1)
{
?>
<?php
while($row_slide = mysql_fetch_array($sql_slide))
{
//print_r($row_slide);
?>
<img src="images/user_images/smallthumb/<?php echo $row_slide['user_image'];?>" border="0" width="80" height="80" data-tooltip="sticky<?php echo $row_slide['id'];?>" />
<?php
}
?>
<?php
}
?>
<?php
$sql_slideh = mysql_query("select * from user_images where user_id = '".$fetch_user['user_id']."' and show_profile = '1'");
while($row_slideh = mysql_fetch_array($sql_slideh))
{
?>
<?php echo $row_slideh['id'];?>" class="atip"> <img src="images/user_images/<?php echo $row_slideh['user_image'];?>" />
<?php if($row_slideh['caption'] != '') { ?>
<?php echo $row_slideh['caption'];?>
<?php } ?>
<?php
}
?>
<form name="viewprofrm" id="viewprofrm" action="" method="post">
<table>
<tr>
<td><input type="hidden" name="favor_id" id="favor_id" value="<?php echo $profid; ?>" /><input type="image" src="images/add_favrt.jpg" name="button" id="button" value="favorite" onClick="return del_prompt(this.form,this.value)" height="68" /></td>
</tr>
</table>
</form>
<a href="send_msg.php?uid=<?php echo $profid; ?>" class=""><input type="image" src="images/snd_mssg.jpg" name="button" id="button" value="Send message" height="68" /></a>
<img src="images/box-bttm.png" />
</body>
</html>