Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing large amounts of data from one page to another without POST?

I'm using a web server framework which works with only GET requests, at the moment I'm trying to pass a large amount of data, that is the text content in a textarea which comes from user input, into another page which echoes the user's input.

I've attempted Querystrings but I end up receiving the error "Requested URL too long".

Any suggestions as to what method I should use?

like image 517
KingAlfredChameleon Avatar asked Oct 31 '22 11:10

KingAlfredChameleon


2 Answers

If you can only send data encoded in GET requests, then you will have to break up the request and send it in multiple parts.

You could either use Ajax or store the entire set of data in localStorage and fetch each chunk in turn as the page reloads.

One approach would be to make a request to an end point that allocates you a unique ID. Then send a series of requests in the form: ?id=XXX&page=1&data=... before closing it with ?id=XXX&total_pages=27 at which point you assemble the different pieces on the server.

This way lies madness. It would be much better to add POST support to your framework.

like image 148
Quentin Avatar answered Nov 09 '22 15:11

Quentin


Try using Javascript Cookies. you can store the textarea value there and then read it in another page (or wherever you want).

Here's a tutorial http://www.w3schools.com/js/js_cookies.asp

like image 20
Luis Sk Avatar answered Nov 09 '22 15:11

Luis Sk