I have two different database tables with two different if for E.G:
id and user_id

one is for user registration and the other is for the members page where they can input their info.
is there anyway to separate the php code from the html code.
here is the code:

PHP Code:
<?php
  error_reporting
(E_ALL E_NOTICE);
  
session_start();
  
$userid $_SESSION['user_id'];
  
$username $_SESSION['username'];
  include(
"../adminonly/admin.php");
  
 if (
$_POST['updateinfo']){
         
// get the form data
         
$fullname $_POST['name'];
         
$bio $_POST['bio'];
         
$location $_POST['location'];
         
         
         
// update db with info
         
if ($fullname && $bio && $location){
             
             
$insert mysql_query("UPDATE profile SET name='$fullname', bio='$bio', location='$location' WHERE user_id='$userid");
             
mysql_query($insert);
             echo 
"Your info has been updated!<br/><br/>";
         }
         else
            echo 
"An error has occured and your info was not updated. Please contact us at: support@separatethescams.com to let us know!";
    }
    
   
 
 
?>


<html>
<title>Members Page</title>
<head></head>
<body>
  <?php
  
if ($username){
     echo 
"Welcome <b>$username</b>, <a href='./logout.php'>Logout</a>";
     echo 
"<br /><a href='./resetpass.php'>Reset Your Password</a>";
  }
  else
     echo 
"Please login to access this page. <a href='./login.php'>Login Here</a>";
     
     
$form "<form action='./member.php' method='post'>
                  <table>
                      <tr>
                        <td>Fullname:</td>
                        <td><input type='text' name='name' /></td>
                      </tr>
                      <tr>
                        <td>Bio:</td>
                        <td><textarea name='bio'></textarea></td>
                      </tr>
                      <tr>
                        <td>Location:</td>
                        <td><input type='text' name='location' /></td>
                      </tr>
                      <tr>
                        <td></td>
                        <td><input type='submit' name='updateinfo' value='Update info' /></td>
                      </tr>
                  </table>
              </form>"
;
              
  echo 
$form;
  
  
$get mysql_query("SELECT * FROM members ORDER BY ID DESC");
  
$numrows mysql_num_rows($get);
  
 if (
$get 1){
     echo 
"No results found!";
 }
 else{
 
  while (
$row mysql_fetch_array($get)){
 
 
$dbuser $row['username'];
 
$fullname $row['name'];
 
$bio $row['bio'];
 
 echo (
'<b>' $dbuser '</b>' '<br/>' $fullname '<br/>' $bio '<br>');
 }  

}
  
  
  
?>
</body>
</html>