473,465 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I redirect and pass the POST data?

I would like to make a redirect and pass the POST data to the redirected
page from the original page. What is the easiest way to do this? Can one
do this by setting the header data in some way. If so, how? Is there a
better way without using sessions. I am rather new to PHP. Thanks

Fred Weinhaus
Mar 4 '06 #1
4 13167
Fred Weinhaus wrote:
I would like to make a redirect and pass the POST data to the redirected
page from the original page. What is the easiest way to do this? Can one
do this by setting the header data in some way. If so, how? Is there a
better way without using sessions. I am rather new to PHP. Thanks
You need to use fsockopen to simulate this.

However, if you want if to transfer contents from one page to another,
just use sessions.
Fred Weinhaus

--
Carl Vondrick
www.carlsoft.net
usenet [at] carlsoft [dot] net
Mar 4 '06 #2
Fred Weinhaus wrote:
I would like to make a redirect and pass the POST data to the redirected
page from the original page. What is the easiest way to do this? Can one
do this by setting the header data in some way. If so, how? Is there a
better way without using sessions. I am rather new to PHP. Thanks

Fred Weinhaus

Chaining POST pages without SESSIONs may be done with GETs.

page1.php grabs the $_POST array.
When it wants to call page2.php, it converts the $_POST values to $_GETs
by doing something like:

$gets='';
foreach($_POST as $key => $value) {
$gets = ($gets == '') ? $key.'='.$value : '&'.$key.'='.$value;
}
header("Location: page2.php?$gets");

page2.php would then grab the values via the $_GET array.

-david-

[UNTESTED] I think you can make pages POST/GET neutral through the
REQUEST array. I keep reminding myself to poke around in REQUEST when I
get some time.

Mar 4 '06 #3
$_REQUEST is the combination of get, post, cookie, in that order.

Cookie overrides parameters specified via post/get
Post overrides parameters specified via get

Mar 4 '06 #4
Richard Levasseur wrote:
$_REQUEST is the combination of get, post, cookie, in that order.

Cookie overrides parameters specified via post/get
Post overrides parameters specified via get


This depends entirely on the value in variable_order in your php.ini file.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 5 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Alex Hunsley | last post by:
A question that has certainly been asked before and I've googled etc. for answers with no certain outcome... I'd like my PHP script to redirect the client browser to another page, POSTing some...
8
by: Victor | last post by:
I need to redirect to another web page, but that redirect will include the submission of form data. So, unlike ServerXMLHTTP which stays on the originating web page, I need the script to redirect...
2
by: Darren Oakey | last post by:
G'day - I have a problem that I just can't figure out how to solve, and would desperately love some help!!! We have an existing product (which we don't have control over) which is a web server...
6
by: Keith Patrick | last post by:
I have to do some programmatic redirects (in several pages) based on URLs I am given from an external source. The URLs have querystrings at the end, but one in particular is about 240 chars long,...
3
by: Brano | last post by:
HI all, I am looking to post XML data to a particular page and also redirect to the same page. I have coded a WebReqest code in page0 that posts the XML to the page1 and then the page1 in its...
5
by: Thom Little | last post by:
In ASP.NET 2.0 C# I need to redirect to an .ASP or .HTML page and include POST data (i.e., formatted like a form. The form data is changed dynamically by the C# page. Can anyone point me to an...
3
by: gustav | last post by:
Hey there, I have this problem: I´m migrating an ASP site to ASP.NET 1.1, and I find myself stuck because of this Form that has some inputs to access an Extranet... When the user submits, the...
5
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= | last post by:
I am trying to create ASPX code which will allow me to redirect a user to another site with POST data. I figure that the best way to do this is with JavaScript to the client. Here's what I'm doing:...
56
by: UKuser | last post by:
Hi, I'm not sure if this can be done as I've searched the web and this forum. I am using an online merchant provider and I must post certain variables to their webforms through a form on my...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.