0

Ok, so my last question was closed because I didn't quite ask it the proper way... What I want to do is, create an HTML form that when submitted outputs the form in a table format and allows you to download that file, or does it automatically, so I guess in short... user navigates to page, fills out form, hits submit, and HTML table asks to download. I hope I asked this correctly . This is something that would help agents at my call center organize and save their abundance of login names and passwords, Thanks

Silentwidow
  • 15
  • 1
  • 5
  • 1
    Stackoverflow is not a place to get code written for you. Tell us what you have attempted and provide some code and we will help you figure out what you might be doing wrong. But we are not here to do it for you. – corylulu Feb 27 '13 at 22:52
  • I understand that I just kept seeing this site come up as a place for assistance, I mainly wanted to know if I was on the right track with thinking it could be done with php, now that I know I know what to focus on to get it done its difficult to find information when you just don't know how to word it or where to start – Silentwidow Feb 27 '13 at 23:13

3 Answers3

0

i did a quick google.
you will want to get the form to submit the data (with possible client side validation)
then do any server side data validation if needbe.
then output the data as a table.
you can also export the table with php code like explained here if you will be opening it with excel for instance.

jsky
  • 2,225
  • 5
  • 38
  • 54
  • Thanks I have been trying to find it but I am still fairly new to Php and it was proving near impossible for me to find, much obliged – Silentwidow Feb 27 '13 at 23:10
  • this link may also be helpful: http://stackoverflow.com/questions/12541000/how-to-export-html-table-to-excel-or-pdf-in-php – jsky Feb 27 '13 at 23:27
0

Have you tried existing services, such as Google Forms?

Peter Kovac
  • 2,257
  • 1
  • 19
  • 18
0

To expand on jskye, it would be something like this to create an HTML table.

//Get POST data from Form
$formData_Name= $_POST['Name'];
$formData_Age= $_POST['Age'];
$formData_Message= $_POST['Message'];

//Modify header information so it knows to download this and how to save it
header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=table.htm");

//Print headers to table
print "<html><body><table>\n\t".
    "<tr>\n\t\t".
     "<th>Name</th>\n\t\t".
     "<th>Age</th>\n\t\t".
     "<th>Message</th>\n\t".
    "</tr>";
//Print form data to table
print "<table>\n\t".
    "<tr>\n\t\t".
     "<td>". $formData_Name ."</td>\n\t\t".
     "<td>". $formData_Age ."</td>\n\t\t".
     "<td>". $formData_Message ."</td>\n\t".
    "</tr>";
//Close form data
print .= "</table></body></html>";
corylulu
  • 3,449
  • 1
  • 19
  • 35