in reply to Passing Data between Scripts

The GET method (query string) is indeed limited. I think the length is browser dependent and is usually anything from 255 chars to 1Kb.

If you have access to a DB, store the data there, then just forward the key as a hidden field or cookie, and use that to retrieve the data when needed.

If you don't, why not just create a temporary file with the data in and just pass an identifier for the file to the next script?

Or, a nice messy way would be to eval final.pl from within upload.pl :) - or just combine them into one script.

.02

cLive ;-)

Replies are listed 'Best First'.
Re: Re: Passing Data between Scripts
by tomhukins (Curate) on Jan 06, 2004 at 11:25 UTC

    Although query string length limits provide one reason to use POST instead of GET, these two methods also have different meanings. Use GET when the request doesn't change anything (such as a search engine query) and POST when the request has an effect (such as updating a database, sending email). See Methods GET and POST in HTML forms or section 9 of RFC 2616.

    If you can't combine your code into one script, you should investigate some kind of session mechanism.

      Interesting. Times like this I feel "Internet Old".

      "Eee lad, back int our day, we didn't have no fancy POST method. We lived and breathed GET. We 'ad it tough. Never mind your fancy mp3 uploads. We couldn't even upload JPEG or GIF files. Well, we wouldn't have uploaded GIF files anyway cause of fear of being sued down't drain by Unisys. But we were 'appy. Happy and poor, because we were poor. Lad.

      cLive ;-)

      --