Undefined INDEXES when logged out on members page
<p>I have a few £Undefined Indexes when logged out on my members page which I'd like to be viewable for non registered users, or users who stumble across that page. </p>

<p>Notice: Undefined variable: userblock in /home/fights7/public_html/rawfeeds.co.uk/members.php on line 28</p>

<pre><code>if($userblock==0) { }
</code></pre>

<p>AND </p>

<p>Notice: Undefined index: id in /home/fights7/public_html/rawfeeds.co.uk/members.php on line 31</p>

<pre><code>if($user2_id==$_SESSION['id']){ }
</code></pre>

<p>I know you can use ISSET, but don't know where to place it in or around these to make them work like they're suppose to. </p>

<p>MEMBER.PHP</p>

<pre><code>&lt;?php
require_once"header.php";
require_once"include/load.php";

if(isset($_SESSION['id'])){
$user1_id=$_SESSION['id'];
}
if(isset($data['id'])){
$user2_id=$data['id'];
}
if(isset($user2_id,$user1_id)){
$userblock = user_core::check_block($user2_id, $user1_id);
}
switch($userblock){
case "1":
echo'&lt;div class="userinfo"&gt;&lt;hr&gt;You Are Blocked From Viewing This Users Profile&lt;hr&gt;&lt;/div&gt;';
break;
}
?&gt;   
&lt;?
$Members = mysqli_query($mysqli,"SELECT * FROM `users` ORDER BY id");
$numRowsMembers = mysqli_num_rows($Members);
while($row = mysqli_fetch_array($Members)){

$members=user_core::getuser($row['id']);  

if($userblock==0){
$user1_id=(isset($_SESSION['id']));
$user2_id=$row['id'];

if(isset($_SESSION['id']) &amp;&amp; $user2_id==$_SESSION['id']){
echo '';
}else{
echo'&lt;div class="userinfo"&gt;&lt;table border="0"&gt;&lt;tr&gt;&lt;td&gt;';
echo '&lt;img border=\'0\' src=\'imgs/cropped'.$user2_id.'.jpg\' onerror="this.src=\'img/no_profile_img.jpeg\'" width=\'40\' &gt;&lt;a href="profile.php?username=' .$row['username'] . '"&gt;' . $members['fullusersname'] .'&lt;/a&gt;&lt;/tr&gt;&lt;/td&gt;&lt;/table&gt;';

?&gt;
&lt;?
$trimmed = trim($row['lives']);
if(!empty($row['lives']))
echo "&lt;b&gt;Lives In:&lt;/b&gt; ".$row['lives'];
echo'&lt;/div&gt;';
?&gt;
&amp;nbsp;
&lt;?
$trimmed = trim(isset($data['work']));
if(!empty($data['work']))
 echo "&lt;b&gt;Works at:&lt;/b&gt; ".$data['work'];
}
}
}

?&gt;
</code></pre>
