mbarros

get2

Jan 24th, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?php
  2.     mysql_connect("localhost", "xxxxxxxxxxxx", "xxxxxxxxx") or die("Não foi possível conectar ao Servidor.");
  3.     mysql_select_db("xxxxxxxxxxxxx") or die("Não foi possível selecionar o Banco de Dados.");
  4.    
  5.     $id = $_GET["id"];
  6.    
  7.     $sql = mysql_query("SELECT * FROM imagens2 WHERE id = $id");
  8.     $l = mysql_fetch_assoc($sql);
  9.    
  10.     header("Content-type: image/jpeg");
  11.    
  12.     $im = imagecreatefromstring($l["Filedata"]);
  13.     $out = imagejpeg($im);
  14.    
  15.     print($out);
  16.    
  17.     imagedestroy($im);
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment