Professional Web Applications Themes

size of submitted textarea field in bytes - PHP Development

i have a textarea where ppl will enter their bio. after they submit the form, i need to compute the size of their bio in bytes _without_ creating any file. is this at all possible ? please advise. sample script: <? if ($_POST['submit']) { print "you have submitted xyz bytes"; } else { ?> <form method=post action="./p.php"> <textarea name="html_code" cols="70" rows="10"></textarea> <input type=submit name=submit value=submit> </form> <? } ?> rgds. --------------------------------------------------- Sign Up for free Email at [url]http://ureg.home.net.my/[/url] ---------------------------------------------------...

  1. #1

    Default size of submitted textarea field in bytes

    i have a textarea where ppl will enter their bio.
    after they submit the form, i need to compute the size of their bio in bytes _without_ creating any file. is this at all possible ?
    please advise.

    sample script:

    <?
    if ($_POST['submit']) {
    print "you have submitted xyz bytes";
    }
    else {
    ?>
    <form method=post action="./p.php">
    <textarea name="html_code" cols="70" rows="10"></textarea>
    <input type=submit name=submit value=submit>
    </form>
    <?
    }
    ?>

    rgds.



    ---------------------------------------------------
    Sign Up for free Email at [url]http://ureg.home.net.my/[/url]
    ---------------------------------------------------
    Sn!Per Guest

  2. #2

    Default Re: [PHP] size of submitted textarea field in bytes

    You receive a string, so you need to find a function that will return
    the size of a string. I bet you will find the function in string section
    of the manual.

    Sn!per wrote:
    > i have a textarea where ppl will enter their bio.
    > after they submit the form, i need to compute the size of their bio in bytes _without_ creating any file. is this at all possible ?
    > please advise.
    >
    > sample script:
    >
    > <?
    > if ($_POST['submit']) {
    > print "you have submitted xyz bytes";
    > }
    > else {
    > ?>
    > <form method=post action="./p.php">
    > <textarea name="html_code" cols="70" rows="10"></textarea>
    > <input type=submit name=submit value=submit>
    > </form>
    > <?
    > }
    > ?>
    >
    > rgds.
    >
    >
    >
    > ---------------------------------------------------
    > Sign Up for free Email at [url]http://ureg.home.net.my/[/url]
    > ---------------------------------------------------
    >
    Marek Kilimajer Guest

Similar Threads

  1. get exact size of textArea
    By floydus27 in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: February 18th, 09:50 PM
  2. Allowed memory size of 8388608 bytes exhausted
    By Paul in forum PHP Development
    Replies: 5
    Last Post: September 18th, 09:20 PM
  3. [PHP] size of submitted textarea field in bytes
    By Jay Blanchard in forum PHP Development
    Replies: 0
    Last Post: August 14th, 11:46 AM
  4. [PHP] get size of variable n bytes
    By Petre Agenbag in forum PHP Development
    Replies: 1
    Last Post: July 16th, 04:29 PM
  5. get size of variable n bytes
    By Petre Agenbag in forum PHP Programming
    Replies: 1
    Last Post: July 16th, 02:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139