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
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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.