Using your tool, I made a form to collect data from prospective applicants to our school. Now, I have the following questions:
1)I am confused about the Delivery Method -I would like the data entered to be stored in an Excel file.Let's say I enter the filename as "Data.xls", where should I create and store this file?
2)Your websites generates the zipped form folder. After extracting the files from this folder, should all the files be on the server?
3)Should the file permissions on all the uploaded files to the server be 777?
4) If I have answers to 1), 2) and 3), upon hitting the submit button, the data should be exported to the Data.xls file, right?
Kindly let me know the answers ASAP!
Thanks!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1.) You do not worry about creating or storing this file if you have chosen the option during the form generation. The file will be created and stored in the "files" folder. This folder is a sub-folder from where the form is located.
2.) Yes, if you want the public to be able to access this form on your web site.
3.) No. Upload the files with default permissions and only change permissions if you have specific functional issues that require it (submit errors).
4.) Yes, you can then download the file any time you want an update. If you chose the email option you will get a message every time someone submits new data.
Feel free to submit more questions to this post if you have any problems.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1.) No. Only the files and folders from the same location as the form.html file.
2.) Should be OK but depends on your host. In some cases the php files need to be executable 755.
3.) Excel files are typically .xls or .csv or a few others. The default is just a text file that is not directly compatible with Excel. You will need to modify the processor.php to create a file that can be loaded into Excel with no additional modifications.
4.) Yes, but it will require some programming of the processor.php file.
Remember this is a free form generator. All your bells and whistles are not going to be available.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Would it be possible for you to send me the php code for saving the data file as a .xls file and for preventing duplication of data? If yes, also please direct as to which file and where I should paste it. If no, would you recommend any online discussion forums where I can get help?
Your email responses have been very helpful!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I helped another person with the same request. The code below is similar and may not match your needs but you can get the basic idea.
Try something like this:
//New csv file output
$csvfile='kitrequest.csv';
//The file must already exist and must contain the first line of column headers
//column1,column2,column3,column4,column5,column6,column7,column8,column9,column10,column12,column13,column14,column15,column16,column17,column18,column19,column20
$fileLine = trim($_POST['field_1'][0]).",".trim($_POST['field_1'][1]).",".trim($_POST['field_1'][2]).",".trim($_POST[' ']).",".trim($_POST['field_2']).",".trim($_POST['field_3']).",".trim($_POST['field_4'])
.",".trim($_POST['field_5']).",".trim($_POST['field_6']).",".trim($_POST['field_7']).",".trim($_POST['field_8']).",".trim($_POST['field_9'])
.",".trim($_POST['field_10']).",".trim($_POST['field_11']).",".trim($_POST['field_13']).",".trim($_POST['field_14'])
.",".trim($_POST['field_15']).",".trim($_POST['field_12']).",".trim($dtstamp)."\n";
if (is_writable($csvfile))
{
if (!$handle = fopen($csvfile, 'a'))
{
echo "Cannot open file ($csvfile)";
exit;
}
if (fwrite($handle, $fileLine)=== FALSE)
{
echo "Cannot write to file ($csvfile)";
exit;
}
fclose($handle);
}
else
{
echo "The file is not writable";
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
a) I have not tried to include the code from your previous message yet. I did a basic form, downloaded the zipped folder to the C:\, extracted all the files and then transferred all the files in the "form" folder onto the server.
I am able to enter data and a thank you message is generated as specified. When I look to find the data in the "files" folder under the "sample.txt" file, its empty. Is there anything I am doing wrong here?
b) Once I get the .txt file to work, I would like to switch over to excel and also ensure that the data is not duplicated for which you have given me the code. I understand that the code is not precisely what I would need but since I am new to PHP, I will probably just be using your code and then ask you if I have any errors. Is that fine? Also, I will probably paste the code in processor.php and load that file to the server. Is that good enough?
Thanks a lot for your continued help!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
a.) The sample file is not intended for your form. I think you should have specified the file name to be used. In any case it may not exist until the first time you use the form. If the file is not accessible you should receive an error.
b.) The code I gave you should replace the code that was generated when you created the form. If you want I can make the adjustments for you but you will have to send your processor.php as an email attachment along with a link to your online form.
For now pasting the code should work but it will essentially duplicate whatever is already in place.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks as always for your patient and quick replies.
Hmm..I followed your directions for a)- specified a file called "data" and checked the "file" option under "Delivery Settings" and clicked "Update Settings". The entering of data and confirmation went smoothly. No errors were generated. But, I was not able to locate the "data" file under the "files" folder. Any suggestions?
For b) - for sure I will send you the processor.php and the link to the form once I can get the "data" file to work.
I checked the "email" option and it works fine.
Thanks!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried again and this time I get the confirmatory message but also get the error which says "The file is not writable". Should I set the permissions for "processor.php" to 744? Or is there a way to set permissions for the "data" file?
Thanks!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Using your tool, I made a form to collect data from prospective applicants to our school. Now, I have the following questions:
1)I am confused about the Delivery Method -I would like the data entered to be stored in an Excel file.Let's say I enter the filename as "Data.xls", where should I create and store this file?
2)Your websites generates the zipped form folder. After extracting the files from this folder, should all the files be on the server?
3)Should the file permissions on all the uploaded files to the server be 777?
4) If I have answers to 1), 2) and 3), upon hitting the submit button, the data should be exported to the Data.xls file, right?
Kindly let me know the answers ASAP!
Thanks!!
1.) You do not worry about creating or storing this file if you have chosen the option during the form generation. The file will be created and stored in the "files" folder. This folder is a sub-folder from where the form is located.
2.) Yes, if you want the public to be able to access this form on your web site.
3.) No. Upload the files with default permissions and only change permissions if you have specific functional issues that require it (submit errors).
4.) Yes, you can then download the file any time you want an update. If you chose the email option you will get a message every time someone submits new data.
Feel free to submit more questions to this post if you have any problems.
Hello TNT,
Thanks so much for the reply.
I have a few more questions:
1)Should the entire unzipped "form" folder be on the server or just the contents of the "form18020" folder.
The path is as follows:
form->tmp->persistent->form18020->calendar, files etctetc.
2) The default settings for files in our server is 644. Will that suffice?
3)Any special instructions to save the file as an Excel file? Is the default a.txt?
4)Is there a way to prevent dupilcation of data? That is, the same student entering his/her information more than once.
Thanks!!
1.) No. Only the files and folders from the same location as the form.html file.
2.) Should be OK but depends on your host. In some cases the php files need to be executable 755.
3.) Excel files are typically .xls or .csv or a few others. The default is just a text file that is not directly compatible with Excel. You will need to modify the processor.php to create a file that can be loaded into Excel with no additional modifications.
4.) Yes, but it will require some programming of the processor.php file.
Remember this is a free form generator. All your bells and whistles are not going to be available.
Hello TNT,
Thanks again!
Would it be possible for you to send me the php code for saving the data file as a .xls file and for preventing duplication of data? If yes, also please direct as to which file and where I should paste it. If no, would you recommend any online discussion forums where I can get help?
Your email responses have been very helpful!
I helped another person with the same request. The code below is similar and may not match your needs but you can get the basic idea.
Try something like this:
//New csv file output
$csvfile='kitrequest.csv';
//The file must already exist and must contain the first line of column headers
//column1,column2,column3,column4,column5,column6,column7,column8,column9,column10,column12,column13,column14,column15,column16,column17,column18,column19,column20
$fileLine = trim($_POST['field_1'][0]).",".trim($_POST['field_1'][1]).",".trim($_POST['field_1'][2]).",".trim($_POST[' ']).",".trim($_POST['field_2']).",".trim($_POST['field_3']).",".trim($_POST['field_4'])
.",".trim($_POST['field_5']).",".trim($_POST['field_6']).",".trim($_POST['field_7']).",".trim($_POST['field_8']).",".trim($_POST['field_9'])
.",".trim($_POST['field_10']).",".trim($_POST['field_11']).",".trim($_POST['field_13']).",".trim($_POST['field_14'])
.",".trim($_POST['field_15']).",".trim($_POST['field_12']).",".trim($dtstamp)."\n";
if (is_writable($csvfile))
{
if (!$handle = fopen($csvfile, 'a'))
{
echo "Cannot open file ($csvfile)";
exit;
}
if (fwrite($handle, $fileLine)=== FALSE)
{
echo "Cannot write to file ($csvfile)";
exit;
}
fclose($handle);
}
else
{
echo "The file is not writable";
}
Hello TNT,
Thanks a lot for the previous reply.
A couple more questions if you don't mind:
a) I have not tried to include the code from your previous message yet. I did a basic form, downloaded the zipped folder to the C:\, extracted all the files and then transferred all the files in the "form" folder onto the server.
I am able to enter data and a thank you message is generated as specified. When I look to find the data in the "files" folder under the "sample.txt" file, its empty. Is there anything I am doing wrong here?
b) Once I get the .txt file to work, I would like to switch over to excel and also ensure that the data is not duplicated for which you have given me the code. I understand that the code is not precisely what I would need but since I am new to PHP, I will probably just be using your code and then ask you if I have any errors. Is that fine? Also, I will probably paste the code in processor.php and load that file to the server. Is that good enough?
Thanks a lot for your continued help!!
a.) The sample file is not intended for your form. I think you should have specified the file name to be used. In any case it may not exist until the first time you use the form. If the file is not accessible you should receive an error.
b.) The code I gave you should replace the code that was generated when you created the form. If you want I can make the adjustments for you but you will have to send your processor.php as an email attachment along with a link to your online form.
For now pasting the code should work but it will essentially duplicate whatever is already in place.
Hello TNT,
Thanks as always for your patient and quick replies.
Hmm..I followed your directions for a)- specified a file called "data" and checked the "file" option under "Delivery Settings" and clicked "Update Settings". The entering of data and confirmation went smoothly. No errors were generated. But, I was not able to locate the "data" file under the "files" folder. Any suggestions?
For b) - for sure I will send you the processor.php and the link to the form once I can get the "data" file to work.
I checked the "email" option and it works fine.
Thanks!!
I'm not sure how much more help I can provide without seeing what you are doing.
Hello TNT,
I tried again and this time I get the confirmatory message but also get the error which says "The file is not writable". Should I set the permissions for "processor.php" to 744? Or is there a way to set permissions for the "data" file?
Thanks!!