how to create and save doc file using php and database : im doing a program for online leave application

after loging in the data is to be saved in a .doc file , which will be used afterwards.
the creation of .doc file is completed using the following code ...
$pdf_data = $pdf->Output('C:\wamp\www\finalproject\mywork\fpdf\lvapp.doc','F');

using this code i am able to create .doc file......

but i need to change the name of file each time and dynamically ....
ie. according to the username of the user....the doc file should have the same name.....

plz help