Jump to content


Photo

Automatic Download of File


  • Please log in to reply
1 reply to this topic

#1 nfr

nfr
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts

Posted 30 May 2006 - 01:35 PM

Hello -

I would like to collect details about an individual (Name, Company Name, Telephone Number, Email Address, Web Address, etc.) in a mySQL table and when then form is submitted, automatically download a file (or email) a PDF file containing the information they have requested. What would be the best way of going about this?

Regards,

Neil.

#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 30 May 2006 - 01:46 PM

<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');

// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');

// The PDF source is in original.pdf
readfile('original.pdf');
?>
[a href=\"http://www.php.net/header\" target=\"_blank\"]http://www.php.net/header[/a]
~ D Kuang




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users