Marek Kilimajer wrote:

Lars Torben Wilson wrote:

Josh Close wrote:

So basically there is no easy way around this.

What I'm trying to do is have a page return to a page that was a
couple pages back with the same get info. On the second page I can do

$return_url = $_SERVER['HTTP_REFERER'];

to get the previous url. But then I need to pass it on to the next
page, then that page will return to the $return_url.

I think passing via $_SESSION vars or cookies would be easier then
doing actual socket posts.


Use session var if you are already using sessions, else use cookie

Sessions are one way to deal with it, and would make the thing much easier than setting your own cookies and hoping the user has cookies' enabled (never a safe bet)--at least, assuming your PHP is configured correctly. However, unless you wanted to send all the form data in the cookie, you then need a way to store the data on the server side, probably in the session manager. Not hard, but not an obvious win over just posting the data where you wish.

In this situation, I would probably combine the two techniques and just
store the $return_url in a session var and then use the postToHost()
function to do the final post back to that page.

If there is an easier way than session or cookies to do this, I'd like to know.

-Josh



It's super easy, actually. There's been a wee bit of code floating around the mailing list for 5 or so years for this:


but try to make the code working in the browser ;)

Not sure what you mean here. The browser is irrelevant with the posting code. Using sessions means more interaction with the browser, not less. The less you need to depend on the browser, the less you'll have to debug. Granted, with the proper setup this is not so much of an issue with sessions, but just posting the data saves a bit of server-side work.


Torben

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to