title: Validate image Resolution in Javascript, PHP
body: <p>I want to validate Image Resolution before upload an image in PHP through Javascript. In my php form , i want to upload two different images and both image have different resolution restriction. </p>
  
  <p>I try the following code</p>
  
  <p>PHP Code</p>
  
  <pre><code>echo "&lt;form name='add' enctype='multipart/form-data' action='AppActions.php' method='post' onSubmit='return validate_create();'&gt;";
  echo "&lt;div class='form_label'&gt;Album Wrapper (Big Image) *&lt;/div&gt;";
  echo "&lt;div class='form_input'&gt;&lt;input type='file' name='bigimage' id='bigimage' /&gt;";
  
  echo "&lt;div class='form_label'&gt;Album Wrapper (Small Image) *&lt;/div&gt;";
  echo "&lt;div class='form_input'&gt;&lt;input type='file' name='smallimage' id='smallimage' /&gt;;
  echo "&lt;input type='submit' name='add' value='Create' class='Buttons' id='add'&gt;";    
  </code></pre>
  
  <p>In Javascript</p>
  
  <pre><code>function validate_create()
  {
  var bigimage = document.getElementById('bigimage');
  var smallimage = document.getElementById('smallimage');
  
  var big_img_width = bigimage.clientWidth;
  var big_img_height = bigimage.clientHeight;
  
  var small_img_width = smallimage.clientWidth;
  var small_img_height = smallimage.clientHeight;
  
  // if condtion to check the condition //
  }
  </code></pre>
  
  <p>Here i am getting width and height for both images as same even i choose different size files.  </p>
  
  <p>How to do this? please suggest me </p>
  
  <p>Thanks in advance</p>