title: Display image after image upload
body: <p>I am developing a social website.In the user registration page,user has the provision to add his photo.I have done this with little effort.My problem is that I want to display the image which has been uploaded by the user to a div,before clicking the submit button at the end of the form.I have searched a lot,but couldn't get the right one. </p>
  
  <p>My html code is like this:</p>
  
  <pre><code> &lt;img src="&lt;?php echo $row_picture;?&gt;" name="picture" class="settingspic"  width="75" height="91" alt="profile pic" name="picture"/&gt;&lt;a href="" onclick="return uploadimg()"&gt; Upload&lt;/a&gt;&lt;/li&gt;
   &lt;input type="file" name="file" id="file" style="display:none;" /&gt;
  </code></pre>
  
  <p>My jasvascript code is:</p>
  
  <pre><code>function uploadimg()
  {
   var uploader = document.getElementById('file');
   uploader.click();
   return false;
  }
  </code></pre>