473,668 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ 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 13180
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.'='.$v alue;
}
header("Locatio n: 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*******@attgl obal.net
=============== ===
Mar 5 '06 #5

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

Similar topics

11
3052
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 data at the same time. (To take them back to an html page showing a form that needs correcting because some data is missing.) I believe this is either tricky or not possible from what I've seen, but I'd just like to see what others think...
8
4882
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 to the page that I'm submitting the POST data to (without pressing a submit button). Any suggestions? Thanks, Victor
2
2759
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 that will produce a PDF document as a report - but from an XML file that is "POST"ed to the document server. I have a listbox that lists various reports that are available, and when you select a report, I want that particular PDF to appear. So,...
6
2900
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, so I need to programmatically redirect to it. Unfortunately, I can't find a way to do it. There is no Response.Form or Response.Attributes (Request has Form and Params, but they are read-only). I've tried using AppendHeader to pass my K/V pairs...
3
2427
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 PageLoad event reads and parses the XML it then saves the data it recieved to cookies. But using this technique the code returns to the page0. I have then used response.redirect(page1) but the cookies are lost...
5
10036
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 example? -- -- Thom Little -- www.tlanet.net -- Thom Little Associates, Ltd. --
3
5926
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 values of the text inputs pass by POST method to a webform in another application (and another server) I find this problems: - ASP.NET pages allow one Form only, which submit just to itself by POST method - Server.Transfer() is useful just to...
5
6656
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: I have a JavaScript function that looks like this: function DoPostRedir() { document.MainFrm.method = "POST"; document.MainFrm.action = "http://XXX.YYY.com/Help/";
56
7214
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 website. The issue is that I need to gauge whether a user has any items in their basket to decide which page I redirect them too. I could
0
8459
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8890
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8791
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8653
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6206
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4376
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2786
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.