title: How to change image based on who logged in
body: <p>I need help on how to make image change after a user logged in. 'coz i'm creating a online radio station and i want my listeners to see who's DJ is currently on-air based on that image. that image is stored in a php page(djonair.php), the image inside that page(djonair.php) will change after the user logged in. then that page is called in the main page(index.html) using iframe. I'm using iframe to call that page because my main page is a HTML page(index.html).</p>
  
  <p>here's my login.php code:</p>
  
  <pre><code>    &lt;?
      session_start();
      if(session_is_registered(myusername)){
      header("location:djmain.php");
      }
      ?&gt;
  
      &lt;font face="calibri" color="white" size="6"&gt;: DJ Log In :&lt;/font&gt;&lt;br&gt;
      &lt;table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"&gt;
      &lt;tr&gt;
      &lt;form name="form1" method="post" action="checklogin.php"&gt;
      &lt;td&gt;
      &lt;table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#005180"&gt;
      &lt;tr&gt;
      &lt;td colspan="3"&gt;&lt;strong&gt;Member Login &lt;/strong&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td width="78"&gt;Username&lt;/td&gt;
      &lt;td width="6"&gt;:&lt;/td&gt;
      &lt;td width="294"&gt;&lt;input name="myusername" type="text" id="myusername"&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td&gt;Password&lt;/td&gt;
      &lt;td&gt;:&lt;/td&gt;
      &lt;td&gt;&lt;input name="mypassword" type="password" id="mypassword"&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td&gt;&lt;input type="submit" name="Submit" value="Login"&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
      &lt;/td&gt;
      &lt;/form&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>here's the code for my checklogin.php:</p>
  
  <pre><code>    &lt;?php
      $host="sqlhostname"; // Host name
      $username="sqlusername"; // Mysql username
      $password="sqkpassword"; // Mysql password
      $db_name="dbname"; // Database name
      $tbl_name="tablename"; // Table name
  
      // Connect to server and select databse.
      mysql_connect("$host", "$username", "$password")or die("cannot connect");
      mysql_select_db("$db_name")or die("cannot select DB");
  
      // username and password sent from form
      $myusername=$_POST['myusername'];
      $mypassword=$_POST['mypassword'];
  
      // To protect MySQL injection
      $myusername = stripslashes($myusername);
      $mypassword = stripslashes($mypassword);
      $myusername = mysql_real_escape_string($myusername);
      $mypassword = mysql_real_escape_string($mypassword);
  
      $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
      $result=mysql_query($sql);
  
      // Mysql_num_row is counting table row
      $count=mysql_num_rows($result);
      // If result matched $myusername and $mypassword, table row must be 1 row
  
      if($count==1){
      // Register $myusername, $mypassword and redirect to file "login_success.php"
      session_register("myusername");
      session_register("mypassword");
      header("location:djmain.php");
      }
      else {
      echo "Wrong Username or Password";
      echo '&lt;br&gt;Go back to &lt;a href="login.php"&gt;log-in&lt;/a&gt; page.';
      }
      ?&gt;
  </code></pre>