Forum Moderators: coopster

Message Too Old, No Replies

Problem passing large amount of text between forms

         

guru5571

7:19 pm on Jul 10, 2005 (gmt 0)

10+ Year Member



Hopefully someone can help with this.

I have created a form that passes several fields of text to a php validation script.

The validation script passes all the info to an html page using a header(Location) redirect that carries all the info in the URL to the preview page.

The preview page then displays all the info.

The problem is, one field is a text-area that usually contains a large amount of text. It passes the data fine to the validation script, but the validation script can't pass it to the html preview page when there is too much data to be passed in the URL.

Consequently the browser will choke on my validation script if there is too much text. If there isn't too much text it all works like a charm, but over the limit and it gets stuck.

I don't know how else to do this without the validation script passing data via the URL since at that point it is no longer $_POST data.

At the end of the day, what I want to be able to do is:

1) Have upload form with multiple fields (one textarea)
2) Validate all the info
3) Show it to the user as a preview

After that I allow them to edit it if they like then I upload it to a database, but the problem is passing that large amount of text from the validation.

I basically want to do what the preview function on forums like this one does. I guess I need a way to pass data from a pure php script without putting it in the URL.

Can someone please help point me in the right direction?

guru5571

8:21 pm on Jul 10, 2005 (gmt 0)

10+ Year Member



I've thought about this more now.

Is this the only way to do this? Instead of forwarding data from the validation page, having the preview page call the validation page and pass the data as hidden fields.

Is the only way to do previews like this with hidden fields?

Any smarties out there have a good suggestion for this?

mogenshoj

4:33 pm on Jul 11, 2005 (gmt 0)

10+ Year Member



Try passing it using method="post" instead of method="get"

That fixed the problem for me in the past.

guru5571

7:38 pm on Jul 13, 2005 (gmt 0)

10+ Year Member



Thanks mogenshoj

I manages to solve the problem by rebuilding the the whole thing.

Now I just have the validation script called by the preview page and pass all fields between the post and preview page in hidden fields