Ver Mensaje Individual
  #12 (permalink)  
Antiguo 19/06/2008, 06:21
chefnelone
 
Fecha de Ingreso: diciembre-2005
Ubicación: Barcelona
Mensajes: 1.428
Antigüedad: 18 años, 4 meses
Puntos: 15
Respuesta: Seguridad para no acceder a ver archivos?

cambios hechos pero sigue descargando 'verDoc.php' en lugar de 'pagweb.pdf'

he probado con GET y con POST ( pero descarga verDoc.php de todas formas)

codigo:

documentos2.php
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<form action="verDoc.php" method="POST" >
<input type="hidden" name="nombrePdf" value="pagweb.pdf" >
<input type="submit" value="Descargar" >
</form>
</body>
</html>
verDoc.php
Código:
<?php
header('Content-type: application/pdf'); 
header('Content-Disposition: attachment; filename="downloaded.pdf"'); 
readfile($_POST['nombrePdf']);
?>