Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/11/2009, 09:59
Avatar de dcreate
dcreate
 
Fecha de Ingreso: octubre-2009
Ubicación: Veracruz
Mensajes: 536
Antigüedad: 14 años, 6 meses
Puntos: 22
Pregunta descargar un archivo

hola amigos, quiero ver si me pueden ayudar, tengo varios archivos de excel en una carpeta de mi servidor y tengo un codigo asi:

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<?php 
if(empty($_POST['forma']))
{
?>
<form id="form1" name="form1" method="post" action="mostrar_lista.php">
  <p>
    <?php 
      
include "conexion.php";
      
conectar();
      
$con=mysql_query("select *from sc");
      echo 
"<select name='forma'id='forma' style='text-transform:uppercase'>";
      echo 
"<option value='0'>Elige..</option>";
      while(
$registro=mysql_fetch_row($con))
      {
      echo 
"<option value='".$registro[0]."'>".$registro[1]."</option>";
      }
      echo 
"</select>";
      

      
?>
</p>
  <p>
    <label>
    <input type="submit" name="enviar" value="Enviar" />
    </label>
</p>
</form>
<?php }else{
$forma=$_POST['forma'].".xls";

}
?>
</body>
</html>
lo q quiero hacer es q cuando encuentra el archivo automaticamento lo descargue, lo unico q me falta es acompletar el else pero no se como hacer, me pueden ayudar