> From: gilles [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 15, 2002 1:19 PM > Subject: [PHP] outputting a pdf file to IE browser? POST/GET > method bug or not? > <? > error_reporting(E_ALL); > > session_start(); > if (!isset($_SESSION['download'])) { > @$_SESSION['download'] = $_POST['download']; > } > > if(isset($_POST["download"])){ > $file_name=$_SESSION['download']; > header("Content-type:application/pdf"); > header("Content-Disposition: inline;filename=\"mypdf.pdf\""); > header("Content-length:".(string)(filesize($file_name))); > header("location: $file_name"); > exit; > } > ?> > <form method=post> > <INPUT TYPE="submit" name=download value="mypdf.pdf"> > </form>
Your code runs fine on my freebsd box running php 4.2.1 and apache. I'd try changing the header into an echo, and see what you're sending to the browser. Are you meaning to only set the session var one time? You only set it when it's not set, so if you change the value of $_POST['download', the session var will still hold the first name. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php