title: Upload script with output url insert into textbox to submit?
body: <p>Sorry for my bad english.</p>
  
  <p>I want a script, which have a image uploader, limit 2mb and one file per use, supported extensions: png, jpg, jpeg, gif. Size 468*70 only. And I need an upload button next to the text box which pastes an image link, and after the upload, it paste the image link to that text box. If user doesn't want to upload, he still can paste link on that and submit, i got my submit button, you can make your, I will recode that.</p>
  
  <p>Image for eg:   <a href="http://i.stack.imgur.com/rzcxv.png" rel="nofollow">http://i.stack.imgur.com/rzcxv.png</a></p>
  
  <pre><code>if(empty($_POST) == false) {
  $_POST['ip'] = htmlspecialchars($_POST['ip'], ENT_QUOTES);
  $_POST['port'] = (int)$_POST['port'];
  $banner   = htmlspecialchars($_POST['banner'], ENT_QUOTES);
  
  if($banner !== ''){
      $imageProp = @getimagesize($banner);
      if($imageProp == false){
          $errors[] = "Banner link is not an image!";
      }
      if($imageProp[0] !== 468 || $imageProp[1] !== 60){
          $errors[] = "Banner is too large or too small, only 468 * 60 accepted. Your image has: " .$imageProp[0]." * ".$imageProp[1];
      }
  }
  
  &lt;div class="form-group"&gt;
      &lt;label&gt;Banner (468 * 60) &lt;/label&gt;
      &lt;input class="form-control" type="text" name="banner" class="span4" /&gt;&lt;br /&gt;
  &lt;/div&gt;
  </code></pre>