Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    rps
    rps is offline
    New Coder
    Join Date
    Sep 2010
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    passing parameters from one page to another

    I have written some code that retrieves data from a MySQL database using PHP. The code cycles through the table building up a string of values (12 in total) from each record read that satisfies certain criteria. The string of values from each record is separated from those from the next record by an ampersand. The code then opens a new page passing the string to another page. The code is.....

    Code:
    header("location:build_calendar.html?".$year."&".$build);
    The new page then displays the resultant calendar (for year quoted) highlighting dates based on the value of $build.

    Typically, for two records that satisfy the criteria, $build looks like this...

    1,5,test1,London,4bb,0800,2,3,4,10,y,r&1,10,test2,Manchester,2bb,0800,2,2,4,10,y,r&
    This works fine in all browsers IE6, Firefox 2.0, Firefox 3.0, Chrome, Avant.

    However, I received a report to say that it does not work with IE8.

    On testing I have found that using IE8 I can successfully pass the parameters if there is only a few of them (for example 20) but when I pass a large number (say 1000) then IE8 reports that it is unable to open the page. I have no problems with other browsers.

    Can anyone please help me to understand why this is happening. Does IE8 have a limit on the number of parameters that can be passed from one page to another?

  • #2
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,313
    Thanks
    4
    Thanked 206 Times in 203 Posts
    The total length of values passed via a URL may be limited and whether or not it will work with very long strings is hit or miss. Sounds like you are hitting one of the miss cases.

    GET submissions are the most restricted. The maximum length of a get
    varies from server to server, browser to browser, OS to OS. You can
    pretty much count on at least 256 characters, but over that you will begin
    to run into problems with some browsers and servers. GET was never
    intended for large amounts of data but rather for information to be
    appended to the URL so that a bookmark and later return is possible (there
    are other uses as well, such as session tracking without depending on cookies
    for instance).

    POST submissions have no limits as defined by the RFCs. However, it is
    not uncommon for scripts to set some arbitrary upper limit to prevent a
    user from uploading data (say a file for instance) so large that it
    impairs either the script's operation or the operation of the limit. The
    real limiting factors in a POST outside of an arbitrary limit set by a
    script programmer are in terms of bandwidth, time (to upload), and memory
    and disk space on the client and server ends of the exchange.
    Dave .... HostMonster for all of your hosting needs

  • #3
    New Coder
    Join Date
    Sep 2010
    Posts
    77
    Thanks
    13
    Thanked 1 Time in 1 Post
    Why not pass it with a hidden form input and use $_POST?

  • #4
    rps
    rps is offline
    New Coder
    Join Date
    Sep 2010
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your replies. The page loaded is written in Javascript (because it is fairly intricate code and I'm not even sure that it could be written in PHP). So, yes, I could have a hidden Form on the PHP page and then "pick it up" in the loaded Javascript page. I've done this in a few pages on the web site but not sure that I have done it from PHP to Javascript. I will look at this approach.

  • #5
    rps
    rps is offline
    New Coder
    Join Date
    Sep 2010
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I couldn't solve it with $_POST as the new page is written in Javascript. The page (actually frame) written in PHP code is closed and opens a new (Javascript coded) frame. If I knew how to load values into another frame using PHP then I could find a solution but I suspect that this is not possible. I have solved it using a mixture of passing parameters and cookies. Not elegant but it works.


  •  

    Tags for this Thread

    Posting Permissions

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