Hello everyone,
I'm not sure if this is possible but i need to send a filled pdf form as an email attachment using pdf. the form is filled with info from the database, for this i am using forge_fdf, this gives me the pdf form to display in the browser here is the code for that, i don't know how this would work, would it be possible to save the form in a folder and then send it in an email as an attachment? i have the script to send an email with a pdf as an attachment the problem i have is that the pdf needs to have some data from the database. i hope someone can help me with this?
Thanks
PHP Code:
require_once('forge_fdf.php');
$fi = mysql_query("SELECT deceased_name,airport,delivery_date,desired_date,recieving_funeral,funeral_address,funeral_phone,departure_city,arriving_city FROM reserve_flight WHERE case_no = '$_GET[id]'") or die(mysql_error());
$fif = mysql_fetch_assoc($fi);
$today = date('m-d-Y');
//print_r($fif);
//exit;
$pdf_form_url= "taca_fax.pdf";
$fdf_data_strings= array('deceased' => $fif['deceased_name'], 'destination' => $fif['arriving_city'], 'delivery' => format_date($fif['delivery_date']), 'arrival' => format_date($fif['desired_date']), 'funeral' => $fif['recieving_funeral'], 'address' => $fif['funeral_address'], 'phone' => $fif['funeral_phone']);
$fdf_data_names= array( 'check1' => 'Off', 'check2' => 'Yes' );
$fields_hidden= array( 'text2', 'check1' );
$fields_readonly= array( 'deceased', 'destination', 'delivery', 'arrival', 'funeral', 'address', 'phone');
header( 'content-type: application/vnd.fdf' );
echo forge_fdf( $pdf_form_url,
$fdf_data_strings,
$fdf_data_names,
$fields_hidden,
$fields_readonly );
I believe the last lines are to display the pdf in the browser is it possible instead of displaying it to save it and prepare it to send it in an email?
Thanks
|