in reply to compress data to pass in url?

Is there any reason why you can't use a POST instead of a GET? With POST, you wouldn't have to encode the data at all. You might still want compression, though.

Replies are listed 'Best First'.
Re: Re: compress data to pass in url?
by glwtta (Hermit) on Jan 17, 2003 at 17:20 UTC
    yes, I want to pass this data to a separate script from the display page so it generates the images on the fly, this saves me having to have temporary image files lying around.

    I other words, my script outputs an html page that has links to these "images" which the browser gets - the user doesn't do anything so there is no opportunity for a post.

      On the contrary, there are ways you can finagle this into POST. One thing I've learned in my tiny dabble into more-interesting-than-html webpages, is that you can use Javascript to do un-formy forms. Here's a concept snippet of what your html could look like:

      <form name="image1" id="image1" method="post" action="image_gen.pl"> <input name="button1" type="button" style="HEIGHT: 28px; WIDTH: 120px" + value="View Image 1" LANGUAGE="javascript" onclick="return button1 +_onclick()"> <input type="hidden" name="image_info" value=" $perl "> </form>
      ..where '$perl' is your info for that first image, retrieved from your post'ed form via whatever method you love best. The trick to making it work without real data to enter and turning that generic button into a submit button is in your headers javascript section:
      function button1_onclick(){ window.document.image1.submit(); }
      Now I'm completely lacking any real javascript knowledge, and I've done scant amounts of web programming, but that's the $3.50 I have to offer your Loch Ness Monster, as unperl as it is.
      Hope that helps,
      -=rev=-
        Except it will break down for people who mistrust Javascript and don't generally turn it on.

        Makeshifts last the longest.