Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/12/2008, 17:10
Avatar de spolli
spolli
 
Fecha de Ingreso: diciembre-2008
Mensajes: 68
Antigüedad: 15 años, 5 meses
Puntos: 0
no puedo mostrar la ruta de la imagen en la base de datos

hace un tiempo postie un problema que tenia al querer subir una imagen a mi servidor ftp y guardar la ruta en la base de datos , bueno hasta ahi bien, todo funciona bien , pero el problema que tengo no puedo mostrar la foto y me tira este error y la verdad que ya no se que hacer

Código PHP:
<form action=<?=$PHP_SELF ?> method="post" enctype="multipart/form-data"/>
<p class="Estilo1">
  <label></label>
</p>
<table width="316" height="66" border="0">
  <tr>
    <td width="87" height="34"><span class="Estilo1">Subir Foto :</span></td>
    <td width="201"><input name="fichero" type="file" /></td>
  </tr><tr>
    <td height="26" colspan="2"><input name="submit" type="submit" value="Subir" /></td>
    </tr>
</table>
<p><?php $link=mysql_connect("localhost","root","pass");
mysql_select_db("sistema_de_noticias",$link);

if (isset(
$_POST['submit'])){
if (
is_uploaded_file($_FILES['fichero']['tmp_name'])){// verifico que haya sido cargado el archivo 
   
$ruta"foto/".$_FILES['fichero']['name'];
   if(
move_uploaded_file($_FILES['fichero']['tmp_name'],$ruta)){ //se coloca en su lugar final
   
              
              
mysql_query("INSERT INTO imagenes (ruta) values ('$ruta')",$link)or die (mysql_error());
             
        }
     } 
 } 

?>
  
  
<?php 
$link
=mysql_connect("localhost","root","pass");
mysql_select_db("sistema_de_noticias",$link);


$result=mysql_query("SELECT * FROM imagenes ",$link);
$row mysql_fetch_array($result) or die (mysql_error());
print_r($row);
?>
</p>
<p> <? echo "<img src='foto/$row[ruta]'>"?>
me tira esto cuando quiero subir una imagen
Array ( [0] => 72 [id_foto] => 72 [1] => foto/presentacion.jpg [ruta] => foto/presentacion.jpg )

Última edición por spolli; 09/12/2008 a las 17:16