Jump to content

Auto process a form...how?


dwest

Recommended Posts

I've got a form with several submit buttons.

The form posts to a processing page which first determines what submit button was clicked, and then runs a corresponding function.
All of those functions post back to the original form with the results of the functions.

I need one of those functions to simply take the posts from the original form and post them back without stopping for the user to click a submit button.

Is that possible?

Thanks!
Link to comment
https://forums.phpfreaks.com/topic/35696-auto-process-a-formhow/
Share on other sites

You could just do a GET request back to the original form page. So in that special function just do a redirect with originalform.htm?postvar1=value1&postvar2=value2 as the URL
If your functions are before the header output, you can use a header location redirect, otherwise you'll have to use javascript redirect.
Any quickie code clips on a javascript redirect so I can use POST?  I know no javascript :-(

I've avoided sessions purposely with this and don't want to use them now just to accommodate this one little thing.  I do appreciate the suggestion though :)

I thought about get but there are a ton of variables as this loop repeats until the user is satisfied.  Are there any side effects of really loooooong urls?
I believe you can if you serialize()/unserialize() it first, though I'm not sure about that...jesirose, any ideas? As far as length, I know that there are no specific limits (in the RFC...I think) other than what a browser will support. Explorer only goes to 2,048 characters...so it might work. If you are thinking that the user might be doing this a lot, then sessions would probably work best, even just on one page.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.