header

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
dizeta
Forum Commoner
Posts: 47
Joined: Mon Feb 02, 2004 9:53 am

header

Post by dizeta »

hi,

i have a link
example:
<a href="download.php?action=download&Id={$nome['id_pdf']}"</a>

how i have to use header to open a pdf file into browser and msword file without download it?

thanks
User avatar
Slippy
Forum Contributor
Posts: 113
Joined: Sat Jul 12, 2003 11:31 pm
Location: Vancouver eh!

Post by Slippy »

I think you need to use content type headers so that the browser knows what file type it is and then it can handle it accordingly. Is it that you don't want the user to be prompted to "Save or Open?"

Code: Select all

<?php
header("Content-Disposition: filename=".$row&#1111;"outline_filename"]);
header("Content-Type: ".$row&#1111;"outline_filetype"]);
header("Content-Transfer-Encoding: binary");

?>
The outline_filename refers to the filename that you want, the filetype is a mimetype such as image/pjpeg or application/pdf

That might help?
Post Reply