This is a discussion on Re: Passing on POST data with Location: within the alt.comp.lang.php forums, part of the PHP Programming Forums category; "DUC" <dulum@eisa.net.au> wrote in message news:3f1487ae$1@news.comindico.com.au > ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
"DUC" <dulum@eisa.net.au> wrote in message
news:3f1487ae$1@news.comindico.com.au > Hi All, > > I want to redirect a page using the Location: header, and at the same > time, pass any $_POST'ed data to that page. > > Does anyone know of a way? > > Thank You, > DUC Do you mean pass the data back to the page on which the form exists (which takes the data from the user) or to pass the data to a new page using the Location:header method? If you want the former, simply make a self submitting form, a hidden field could be used to detect the form has been submitted, so the new section of html could be outputted rather than the form itself. If its the latter you have a few options. The first is by attaching the variables to the Header:location url as using the GET method i.e. location.php?var1=$var1&var=$var2. If you don't want your address to contain the variable data, the other method is by invoking a session for the duration of calling the new page. once the new page is loaded, pull the data from the session and if its no longer needed, simply destroy it. |
|
|||
|
I think the solution with the session vars is the better and the safest.
Sergiu. "^MisterJingo^" <misterjingo@keysurf.net> wrote in message news:<od0Ra.1275$Fz2.667@news-binary.blueyonder.co.uk>... > "DUC" <dulum@eisa.net.au> wrote in message > news:3f1487ae$1@news.comindico.com.au > > Hi All, > > > > I want to redirect a page using the Location: header, and at the same > > time, pass any $_POST'ed data to that page. > > > > Does anyone know of a way? > > > > Thank You, > > DUC > > Do you mean pass the data back to the page on which the form exists (which > takes the data from the user) or to pass the data to a new page using the > Location:header method? > > If you want the former, simply make a self submitting form, a hidden field > could be used to detect the form has been submitted, so the new section of > html could be outputted rather than the form itself. If its the latter you > have a few options. The first is by attaching the variables to the > Header:location url as using the GET method i.e. > location.php?var1=$var1&var=$var2. If you don't want your address to contain > the variable data, the other method is by invoking a session for the > duration of calling the new page. once the new page is loaded, pull the data > from the session and if its no longer needed, simply destroy it. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|