Jump to content

redirecting


jalea148

Recommended Posts

There are 3 pages: A, B, C; B resides on another server.

 

With Session variables I can share form data on A with C when I post directly to C. However, if I post to B and redirect to C, sharing doesn’t seem to work with C. If this is possible, what are the guidelines [i.e. what needs to be added beyond what was necessary when the form in A posted directly to C]?

 

Link to comment
Share on other sites

tried cookies - no luck. If the post goes directly to C from A, POST, session variables and cookies all work - the form data from A appears in the form on C. However, if the form in A posts to a different form [off the server] and gets to the form on C via Redirect, no data appears in C's form.

Link to comment
Share on other sites

You either have to post the data using www.php.net/cURL OR you have to attach the data via GET or POST (post with curl) as cookies and sessions will not work across domains as someone else pointed out.

Link to comment
Share on other sites

in your config or in php.ini (doesnt really matter), find the auto_prepend_file part (or just put it in the config under where you added the php file types) and add

 

auto_prepend_file /data/sess.php

 

and in ~/data/sess.php have the following

 

<?php

session_start();

?>

 

 

 

that's a lazy way to do it, and also saves space :)

Link to comment
Share on other sites

I don't control the server with pages A or C where they reside. So, it may be difficult to get at the auto_prepend_file, config or php.ini  files. Page B is on still another server.

 

Rather than using a redirect to bring up page C, would it be possible for the action in Page A to post to both page B and page C [using only 1 submit button]? Page B is never accessed by the user who should only see page C. [b is a service that requires it incoming data from a POST??? There would not be a problem if they accepted email.] Validation is required on page A. This would solve the cookie problem.

 

BTW, I can't trick it by posting directly to Page C - it already posts to formmail.php and redirects to thank you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.