can one set post_max_size in form?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • veg_all@yahoo.com

    #1

    can one set post_max_size in form?

    I dont have access to my php.ini file so I am trying the following
    which doesn't seem to work:

    <input type=hidden name=post_max_s ize value=100000>

    I know it can be done for file uploads, but can it be done for posting
    data?

  • petersprc@gmail.com

    #2
    Re: can one set post_max_size in form?

    If you're using Apache, you can try setting LimitRequestBod y to the
    desired limit in bytes. For example: "LimitRequestBo dy 100000". This is
    available in .htaccess as well as the global configuration. See


    You can also try setting PHP's post_max_size directive in apache if
    php.ini is off-limits. For example: "php_value post_max_size 100000".
    See http://us3.php.net/manual/en/ini.cor....post-max-size

    Another option is to use client-side browser validation. You can set
    the maxlength attribute on a text field or use javascript to check the
    length of a textarea before submitting. These limits could be bypassed
    by a user determined to do so however. An example of client-side input
    length checking:

    <script type="text/javascript">
    <!--
    // Don't allow more than length chars
    function checkTextareaLe n(textarea, length)
    {
    if (textarea.value .length length) {
    textarea.value = textarea.value. substring(0, length)
    }
    }
    //-->
    </script>

    <form method=post>

    <input name=text1 maxlength=5 <!-- Browser should limit text1 to 5
    chars -->

    <textarea name=text2
    onKeyDown="chec kTextareaLen(th is, 20)"
    onKeyUp="checkT extareaLen(this , 20)"
    onChange="check TextareaLen(thi s, 20)"
    ></textarea>
    <input type=submit>

    </form>

    See here for a more advanced script that allows you to set maxlength on
    textarea elements: http://www.quirksmode.org/dom/maxlength.html

    Best Regards,

    John Peters

    veg_all@yahoo.c om wrote:
    I dont have access to my php.ini file so I am trying the following
    which doesn't seem to work:
    >
    <input type=hidden name=post_max_s ize value=100000>
    >
    I know it can be done for file uploads, but can it be done for posting
    data?

    Comment

    Working...