Jump to content

jcg

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by jcg

  1. it's true ... but I want to save the images in database...associated with a register...so I don't worry about the name nor location...
  2. thanks for the reply! And I've tried readfile($content); ...but not worked No, 'foto' in my database is image data, is a field LONGBLOB. Appreciate your help. Thanks JCG
  3. Hi all, Instead of image, always gives empty square with red cross!!!! :'( why???? I've tried everything... other ways, other foruns, ... I'm getting crazy!!!!! will not have to do with the Apache server? I can not visualize the temporary file on the server, for example "var/www/html/images/phpmYEYF9" i use a trick...i copy the tmp file "var/www/html/images/phpmYEYF9" that i can not see, to the same place with copy($****,'images/xpto.jpg') then...well I see the image ... but an image from the database, from the tmp file ... always gives empty square with red cross... Appreciate your help. Thanks JCG <!--teste.php--> <?php ini_set('upload_tmp_dir','/var/www/html/images/'); chmod('/var/www/html/images/', 0777); $con = mysql_connect('********','*****','******') or die('Erro a ligar SQL!!!'); /* Remote server Apache and MySQL ---- works fine, no errors! */ $db = mysql_select_db('*****') or die('Erro a ligar DB!!!'); /* works fine, no errors! */ $sql = "SELECT foto,id FROM fotos"; /* works fine, no errors! */ $result = mysql_query("$sql") or die("Invalid query: " . mysql_error()); /* works fine, no errors! */ ?> <table border="1"><tr><td>id</td><td>image</td></tr> <?php while($row=mysql_fetch_assoc($result)){ print '<tr><td>'.$row['id'].'</td><td>'; print '<img src="show.php?id='.$row['id'].'" height="75" width="100">'; } echo '</td></tr></table>' ?> <!--show.php--> <?php ini_set('upload_tmp_dir','/var/www/html/images/'); chmod('/var/www/html/images/', 0777); $con = mysql_connect('********','*****','******') or die('Erro a ligar SQL!!!'); /* Remote server Apache and MySQL ---- works fine, no errors! */ $db = mysql_select_db('*****') or die('Erro a ligar DB!!!'); /* works fine, no errors! */ ob_start(); $query = mysql_query("SELECT foto FROM fotos WHERE id={$_GET['id']}"); $row = mysql_fetch_array($query); $content = $row['foto']; header('Content-type: image/jpg'); echo $content; ob_end_flush(); ?>
  4. Hi all, I followed all the steps in this topic, but still getting empty square with red cross. I did not include the code, because it is the same as this topic. I've tried everything... other ways, other foruns, ... I'm getting crazy!!!!! will not have to do with the apache server? if an image is from the / images folder, okay ... but an image from the database ... always gives empty square with red cross... Appreciate your help. Thanks JCG
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.