Jump to content

Making a spreadsheet form in PHP?


tamumech

Recommended Posts

Howdy,

 

I am building a website that will create a massive database.  I need to make a spreadsheet where a registered user can input data that will be stored in a MySQL database.  Each spreadsheet submitted will be about 25 rows and 15 columns (375 elements).  Should I basically make a form with each field a cell in the spreadsheet?  Or is there an easier way?

Link to comment
https://forums.phpfreaks.com/topic/55796-making-a-spreadsheet-form-in-php/
Share on other sites

That is the easiest, but there are more sophisticated methods that would involve using 3rd party tools (free or paid). I've seen a spreadsheet like control that was very slick, but I cannot find it right now.

 

But, utilizing a little CSS you could certainly utilize text fields that look and work much like a spreadsheet.

 

I even have a script somewhere that allows me to navigate through the fields in a "table" form just like you would in Excel. I can't seem to find it though - may be on my PC at work. Anyway, take a look at this mockup:

 

<html><head>
<style>
.head {
  background-color: #cecece;
  text-align: center;
  border: 1px solid #696969; 
}

.cell {
  border: 1px solid #cecece; 
}

.cellinput {
  border-width:0px;
  width: 100px;
}
</style>
</head>

<body>

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse;">
<tr>
<td class="head"> </td>
<td class="head">A</td>
<td class="head">B</td>
<td class="head">C</td>
<td class="head">D</td>
<td class="head">E</td>
</tr>
<tr>
<td class="head">  1  </td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
</tr>
<tr>
<td class="head">  2  </td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
</tr>
<tr>
<td class="head">  3  </td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
</tr>
<tr>
<td class="head">  4  </td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
</tr>
<tr>
<td class="head">  5  </td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
<td class="cell"><input type="text" class="cellinput"></td>
</tr>
</body>
</html>

Well, they aren't submitted one by one, they are submitted all at once. I worked on a web-based application in the past where the client had 120 x 6 fields on one page. There was no real performance issue with the submission of the data. The only delay was caused by the fact that we were creating customized PDFs based upon the input. Doing database inserts should take no time at all as long as you do it efficiently.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.