Advertisement
GWibisono

show_image.php

Dec 13th, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. <?php
  2. $image = $_POST['name'];
  3. $filename = 'media/'.$image;
  4.  
  5. if(is_file($filename)){
  6.     $html="<img width=200 height=200 src='{$filename}' />";
  7.     $result=array('html'=>$html);
  8. }
  9. else{
  10.     $html='No image found';
  11.     $result=array('html'=>$html);
  12. }
  13.  
  14. echo json_encode($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement