Results 1 to 14 of 14

Thread: limits [Resolved]

  1. #1

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    limits [Resolved]

    Is there any limits on the length of a string or a URL?
    Last edited by ober0330; May 12th, 2004 at 12:18 PM.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

  3. #3

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Thanks.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  4. #4
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    mine worked on 8193

    that was in FX.
    Have I helped you? Please Rate my posts.

  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    A client and/or host is not obliged to parse a URL greater than 255 characters. This means there is a soft limit of 255 characters, however most browsers have something like 2048 caracters.

    The only rule is that you must be able to handle a URL upto 255 characters beyond that (well its up to the vendor).
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  6. #6

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Well, I'm creating the URL, so I'm just wondering if I need to try and shorten it or switch to a POST method. I just tested one that was 318 characters... and that's probably about the shortest it is going to be.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  7. #7
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    what about using cookies? They can be millions of characters long.
    Have I helped you? Please Rate my posts.

  8. #8

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Using cookies for this purpose seems a little over the top.

    Here's what I'm doing: I have a form that has several drop-downs and then other random form elements. Whenever they select something from the dropdown, I have to grab values from a database, hence, I have to reload the page, and when I do that, I don't want to lose all the input they have made, so I have a script that takes all the current values and writes them out to a URL and then when the page reloads, it grabs all the old values from the URL and stuffs them back into the form elements. Cookies seem like overkill for this.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  9. #9
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    That could start getting very annoying fo the user. If the query string is that long, then the form is probably quite large. when means the user chooses quite a bit of stuff which means the page refreshes quite a few times. This could really start bugging them.

    If the database isn't that big, and its contents are not sensetive information. then you could load the whole thing into a JS array, then use that to change the form. This won't require a refresh, but if the DB is huge then of course this would get very cumboursome.
    Have I helped you? Please Rate my posts.

  10. #10

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Well, the DB is of decent size.... so I don't know if I'd want to load everything into an array. And there are only 3 dropdowns that require the page to be refreshed, so it's really not that bad, and usually, those are the first 3 things that are picked.

    The form also isn't that big, but it does have 3-4 textareas which is where the URL could get bloated (most cases not, however).

    Could you explain how to load values into a javascript array in case I'd want to go that route? That is the part I don't understand... right now, all my SQL queries are in PHP and I'm connected to a MS SQL 2000 Server. Can you setup queries in Javascript?

    I guess I should also add that all of this is internal work for my company... so speed/loadtime isn't much of an issue as the data is passed across 100mbps connections. That's why I wasn't afraid to use the refresh option. I'd imagine filling JavaScript arrays wouldn't take a terrible amount of time either.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  11. #11
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    Oh, in that case, you shold stick to how you're doing it.

    JS can't do queries, but you could have JS dynamically change the form onBlur or onChange.

    to load the db into an array, simply loop through each item in the db and enter it in the array. so:
    PHP Code:
    //untested
    <script type="text/javascript">
    myArray = new Array()
    <?
    //create a loop going through each item in the database
        {
        echo "myArray[myArray.length] = current_query";
        }
    ?>
    </script>
    Have I helped you? Please Rate my posts.

  12. #12

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Well, I currently use the onChange method to reload the form. I'm not going to make them hit a button to do the refreshes... that would annoy them.

    Maybe I'll implement the array idea as an upgrade in the future.

    edit: Thanks for your help.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  13. #13
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    In the OnChange event, how about submitting the form to the same page? That'll be POST, and no URL problems.

    You can retrieve the values, set the text/combo boxes.

    If the user clicks submit, set a dirty variable, so that you know it's the real submit, and then process the info.

  14. #14

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Now there's an idea I didn't think about... although the coding is already done to do it the other way.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

Posting Permissions

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



Click Here to Expand Forum to Full Width