txt.file format problem in PHP Urgent!!
Posted: Tue Sep 16, 2008 11:38 pm
Hi..need ur guys help.I have one feedback form.The feedback form then will be kept as .txt file.My client want me to save d txt file as blow:
File name format: "enquiry-yyyyMMdd-hhmmss-X.txt" where yyyyMMdd : indicate date. example 20070816, hhmmss: indicate international time the enquiry generated in hour, minute, second. example 131520 (for 1:15:20 PM) and X: indicate the sequence no.
My problem now is.. i save d file without sequence number. I dont know how to do that..
This part of my code :
$b = 1;
$myFile = "$imagePath/irda_txt/enquiry-".date("Ymd-Gis").$b.".txt";
$fh = fopen($myFile, 'x+') or die("Can't open file");
$stringData = "$title"." $name"." $email"." $work_tel"." $mobile"." $fax"." $modecomm"." $timecomm"." $company"
." $industry"." $activities"." $website"." $enquirycat"." $enquiry";
fwrite($fh, $stringData);
fclose($fh);
File name format: "enquiry-yyyyMMdd-hhmmss-X.txt" where yyyyMMdd : indicate date. example 20070816, hhmmss: indicate international time the enquiry generated in hour, minute, second. example 131520 (for 1:15:20 PM) and X: indicate the sequence no.
My problem now is.. i save d file without sequence number. I dont know how to do that..
This part of my code :
$b = 1;
$myFile = "$imagePath/irda_txt/enquiry-".date("Ymd-Gis").$b.".txt";
$fh = fopen($myFile, 'x+') or die("Can't open file");
$stringData = "$title"." $name"." $email"." $work_tel"." $mobile"." $fax"." $modecomm"." $timecomm"." $company"
." $industry"." $activities"." $website"." $enquirycat"." $enquiry";
fwrite($fh, $stringData);
fclose($fh);