Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
attach filled pdf form on email
Old 08-10-2012, 03:49 PM attach filled pdf form on email
Super Talker

Posts: 116
Name: Joan
Trades: 0
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
stivens is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-14-2012, 06:28 AM Re: attach filled pdf form on email
King Spam Talker

Posts: 1,110
Name: Paul W
Trades: 0
Yes, you can save the data as a file and then email it - I've used swiftMailer in the past.
__________________
Great music:
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
PaulW is online now
Reply With Quote
View Public Profile
 
Old 08-14-2012, 06:46 PM Re: attach filled pdf form on email
Super Talker

Posts: 116
Name: Joan
Trades: 0
is swiftMailer to email the attached file?

I already have a script to email attached files my problem is how to save the pdf in a folder on the server after the data has been populated into the form?
stivens is offline
Reply With Quote
View Public Profile
 
Old 08-14-2012, 10:26 PM Re: attach filled pdf form on email
King Spam Talker

Posts: 1,110
Name: Paul W
Trades: 0
fdf_save
__________________
Great music:
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
PaulW is online now
Reply With Quote
View Public Profile
 
Old 08-14-2012, 10:53 PM Re: attach filled pdf form on email
Super Talker

Posts: 116
Name: Joan
Trades: 0
could you please help me a little more with this? i would really appreciate it

how do I use fdf_save?

PHP Code:
$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' ); 

$fdf_doc forge_fdf$pdf_form_url

                
$fdf_data_strings,  

                
$fdf_data_names

                
$fields_hidden

                
$fields_readonly );  


fdf_save($fdf_doc,$filename
where will the file be located?

Thanks
stivens is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to attach filled pdf form on email
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18911 seconds with 11 queries