Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

URL length failing in IE

adrianbj
2010-03-12
2013-05-28
  • adrianbj
    adrianbj
    2010-03-12

    Hey Matthias,

    As you know I am using fetchDataFromURL for creating individual publication lists for all our staff, but I also use an iframe approach to generate an inline browser (http://ian.umces.edu/papers/) of all publications for our entire group (which is a very small subset of all the pubs in our database). The problem is I just noticed that the length of the URL that is being dynamically generated from our staff database has got so big that it now exceeds the URL length limit for IE. It is currently up to 4990 characters and according to http://www.boutell.com/newfaq/misc/urllength.html the limit for IE is 2083. Firefox is still working fine, but apparently apache has a limit of around 4000, so I expect it is not far of failing at the server.

    Just wondering if you have any thoughts on how to go about making this URL shorter. Maybe I need to hack together an intermediate file to pass the variabled to search.php via POST or something.

    Thanks for any ideas.
    Adrian

     
  • Hi Adrian,

    The design of your pages and the integration with refbase is really nice! Sorry to hear you're facing trouble. Using Safari 4.0.5 for Mac, I see the issue as well. E.g. when trying to change any of the display options in Citation View, I get:

    Request-URI Too Large
    The requested URL's length exceeds the capacity limit for this server.

    I fear that the current URL design won't change in the near future, so we'd need to find a workaround here. The workaround you mentioned might be a possible solution to the problem:

    Just wondering if you have any thoughts on how to go about making this URL shorter. Maybe I need to hack together an intermediate file to pass the variabled to search.php via POST or something.

    Alternatively, I could imagine to use a unique contribution ID, keyword or note string instead of the full list of authors. This would significantly reduce the length of the URLs. However, this has the drawback of not being automatic, i.e. each article that is supposed to be displayed in your group bibliography would need to get tagged with the correct contribution ID, keyword or note string.

    To make this more automatic, one could create a cron job that would run a small script (on a daily or weekly basis, etc) which would query the refbase database for all of your group's authors and set the correct contribution ID, keyword or note string automatically. Your iframe URL could then use a simple 'show.php' URL like these:

    show.php?contribution_id=…
    show.php?keywords=…
    show.php?notes=…

    HTH, Matthias

     
  • Hi Adrian,

    //AJ added this to generate query string here, rather than passing via URL because it was getting too long for IE to handle
    if($sqlQuery=="group"){
    include '/path/papers/query_function.php';
    $sqlQuery = generateSQLQuery();
    }

    This should work, but I guess this doesn't help with subsequent calls to 'search.php' links (e.g. when a user clicks the "previous/next search results" links), since the generated $sqlQuery gets included (in it's expanded form) within the links & forms, right?

    Thanks, Matthias

     
  • adrianbj
    adrianbj
    2010-03-14

    Ah, very good point - that is what you get for problem solving and coding while on a conference call - I did forget to check the page links etc. I have gone with your contribution ID suggestion, being set automatically by a scheduled query to match staff to publications.

    Thanks for the suggestion.

    Cheers,
    Adrian

     
  • Hi Adrian,

    your initial approach (i.e. using 'sqlQuery=group') might work if you'd again replace the expanded SELECT clause with the "group" placeholder before the query gets included in the HTML pages. However, I'm not sure whether this would be too much of a hack.

    I have gone with your contribution ID suggestion, being set automatically by a scheduled query to match staff to publications.

    Good!

    Best regards, Matthias

     
  • adrianbj
    adrianbj
    2010-03-15

    I looked into replacing the expanded SELECT, but it was starting to get a little out of hand. I also realized that I also needed to get it working for rss.php as well as linking directly to a full version of Refbase via show.php anyways.