Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 08, 2016, 11:56:34 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: How big is the HTML 'hidden' field?  (Read 3854 times)

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,282
    • View Profile
    • Donate to Member
How big is the HTML 'hidden' field?
« on: August 09, 2009, 06:43:17 PM »
Folk,

I've searched this for a couple of days, but cannot find any definitive answer.

I need to make a comparison between a hidden field and a text area in order to determine whether to update a TEXT (BLOB) field in MySQL.

But I don't know, and cannot seem to discover, what limit might exist for the HTML hidden field.  I've found several discussions on setting the MAXLENGTH property, but none on the max of that property.

I'd prefer to compare the textarea and the hidden field for changes rather than make several requests to MySQL, on the theory that local system RAM is [usually] less expensive than the requests to the host.

Please offer any advice/comments on size limit(s), or even on procedure - I'm amenable to change, should that be warranted.


housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
Re: How big is the HTML 'hidden' field?
« Reply #1 on: August 10, 2009, 06:11:06 AM »
can't you store a hash value in the hidden field and compare that with the new hash from the textarea? that way, you can easily store the data in the hidden field.

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,282
    • View Profile
    • Donate to Member
Re: How big is the HTML 'hidden' field?
« Reply #2 on: August 10, 2009, 08:19:54 PM »
This will be PHP 4.x, so hashing is pretty much out of the question, as far as I know.  Don't know how large sha or md5 will go.  Mhash not available, as provider won't install it.  But, even with a hash, I still have the same question as to the length allowed, this time related to the hash capability.

Funny, never bothered me for years, but now I've just gotta know <chortle />.

While I'm not expecting any novels, there's a fair chance that some of the text area content could approach - maybe surpass - 64K in size, with one or two being even larger.

I wonder if it might be more effective to save the MySQL text field as a file, then do a compare with the textarea?  Not certain how CPU-/memory-intensive that might be, and it would definitely need to be server-side, a situation I'm trying to avoid.  Not certain I know enough JS to do that locally.

Only other alternative I can see at the moment is just to do an automatic update to the text field ... but that's another query call on the server, and there are already more than I'd like.  <Sigh /> PC-File was so much simpler <groan />.

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
Re: How big is the HTML 'hidden' field?
« Reply #3 on: August 11, 2009, 05:08:50 AM »
MD5 are 128bit or 16byte long, regardless of input size.

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,282
    • View Profile
    • Donate to Member
Re: How big is the HTML 'hidden' field?
« Reply #4 on: August 11, 2009, 12:38:30 PM »
Yeah, I'm familiar with the output ... usually use it for passwords.  It's that, "...regardless of input size," that's bugging me.  Just as with the hidden HTML field, I have not found any mention of the upper limit(s).  I know the relative sizes of the MySQL text/blob fields, and can plan accordingly.  But w/o having some reference to the upper limits of the hidden field or to the hashing functionality, I'm just gambling.  Things only have to fail once in a commercial environment and my name is Mudd.

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
Re: How big is the HTML 'hidden' field?
« Reply #5 on: August 11, 2009, 01:28:19 PM »
md5 does not have a limit of the input data. That is what I meant with "regardless of input size": no matter how much or how little data you provide as input, you always get a result that is 128 bits long.

I strongly suggest you upgrade to php5. If you deal with such large amounts of data, php5 will be much better.

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,282
    • View Profile
    • Donate to Member
Re: How big is the HTML 'hidden' field?
« Reply #6 on: August 11, 2009, 01:40:23 PM »
OK,

I have a workaround.  Add another textarea with DISPLAY:none.  Not wild about it, but should be functional.  Still like to know those upper limits, though <sigh />.

barney

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,282
    • View Profile
    • Donate to Member
Re: How big is the HTML 'hidden' field?
« Reply #7 on: August 11, 2009, 01:45:32 PM »
I'd love it if PHP5 were available, but I have to work within the limits of the client's hosting.  According to her, the host has no immediate plans to upgrade PHP.  Caution when upgrading is understandable, but this seems a bit extreme.  Oh, well ... who am I to say?

Anyway, thanks for the help.  Now I have belt and suspenders <chortle />.