473,383 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Redirecting on the server side?

Hello,

I'm using PHP 4.4.4. After processing some data, I'd like to redirect
to another page for further data processing. The way I'm redirecting
right now is

header("Location: next_page.php");

However, as you know this causes information to be sent to the client
before the next page is contacted. Is there a way I can go to
"next_page.php" without contacting the client?

Thanks, - Dave

Oct 9 '06 #1
7 1303
On 9 Oct 2006 06:23:57 -0700, "la***********@zipmail.com"
<la***********@zipmail.comwrote:
>Hello,

I'm using PHP 4.4.4. After processing some data, I'd like to redirect
to another page for further data processing. The way I'm redirecting
right now is

header("Location: next_page.php");

However, as you know this causes information to be sent to the client
before the next page is contacted. Is there a way I can go to
"next_page.php" without contacting the client?

Thanks, - Dave
You can use include() to display the contents of the page. Depending
on what you are doing on the page that is processing the data, a
flush() and ob_flush() may be required before the include call.

Oct 9 '06 #2
Thanks for your reply. The page I want to invoke accesses data from
$_REQUEST. So I wanted to call the page in this fashion

next_page.php?var1=val1&var2=val2&var3=val3

"includes" don't take query strings, if I remember correctly. Any way
to invoke the above?

Thanks, -

Tyrone Slothrop wrote:
On 9 Oct 2006 06:23:57 -0700, "la***********@zipmail.com"
<la***********@zipmail.comwrote:
Hello,

I'm using PHP 4.4.4. After processing some data, I'd like to redirect
to another page for further data processing. The way I'm redirecting
right now is

header("Location: next_page.php");

However, as you know this causes information to be sent to the client
before the next page is contacted. Is there a way I can go to
"next_page.php" without contacting the client?

Thanks, - Dave

You can use include() to display the contents of the page. Depending
on what you are doing on the page that is processing the data, a
flush() and ob_flush() may be required before the include call.
Oct 9 '06 #3
I think what Tyrone was getting at was that you could process the data
on your first page. Then, once that is done you can include your second
page where all of the query string variables from the first page would
be available to the include page.

You could, with a little process in the first page, call different
include pages based on what was sent to the first page.

REGARDS
-------------
la***********@zipmail.com wrote:
Thanks for your reply. The page I want to invoke accesses data from
$_REQUEST. So I wanted to call the page in this fashion

next_page.php?var1=val1&var2=val2&var3=val3

"includes" don't take query strings, if I remember correctly. Any way
to invoke the above?

Thanks, -

Tyrone Slothrop wrote:
>On 9 Oct 2006 06:23:57 -0700, "la***********@zipmail.com"
<la***********@zipmail.comwrote:
>>Hello,

I'm using PHP 4.4.4. After processing some data, I'd like to redirect
to another page for further data processing. The way I'm redirecting
right now is

header("Location: next_page.php");

However, as you know this causes information to be sent to the client
before the next page is contacted. Is there a way I can go to
"next_page.php" without contacting the client?

Thanks, - Dave
You can use include() to display the contents of the page. Depending
on what you are doing on the page that is processing the data, a
flush() and ob_flush() may be required before the include call.
Oct 9 '06 #4
la***********@zipmail.com wrote:
Thanks for your reply. The page I want to invoke accesses data from
$_REQUEST. So I wanted to call the page in this fashion

next_page.php?var1=val1&var2=val2&var3=val3

"includes" don't take query strings, if I remember correctly. Any way
to invoke the above?
You don't need to. Those vars are already within the scope of the
included file.

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*****************************
Oct 9 '06 #5
<la***********@zipmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
Thanks for your reply. The page I want to invoke accesses data from
$_REQUEST. So I wanted to call the page in this fashion

next_page.php?var1=val1&var2=val2&var3=val3

"includes" don't take query strings, if I remember correctly. Any way
to invoke the above?

You could use full path:

<?php

include('http://www.your.domain/next_page.php?foo=bar');
exit();

?>

But as other people have already stated, your varables are available in the
included page just as well.

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
sp**@outolempi.net | rot13(xv***@bhgbyrzcv.arg)
Oct 10 '06 #6
Kimmo Laine wrote:
<?php

include('http://www.your.domain/next_page.php?foo=bar');
Unless next_page.php generates PHP, the script with this include will
only get HTML.
exit();

?>
next_page.php

<?php
if (isset($_GET['foo'])) {
echo '<?php echo $_GET[\'foo\']; ?>';
} else {
echo '<?php echo \'Not available\'; ?>';
}

--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot
Oct 10 '06 #7
"Pedro Graca" <he****@dodgeit.comwrote in message
news:sl*******************@ID-203069.user.individual.net...
Kimmo Laine wrote:
><?php

include('http://www.your.domain/next_page.php?foo=bar');

Unless next_page.php generates PHP, the script with this include will
only get HTML.
Since the object was to only invisbly redirect to the page, it doesn't
matter. A real issue would be that in this case cookie and session data
would not be available in next_page.php since it's the server fetching the
page, not the client.

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
sp**@outolempi.net | rot13(xv***@bhgbyrzcv.arg)
Oct 11 '06 #8

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

Similar topics

25
by: Rob Tweed | last post by:
Two inter-related questions: If I'm in PHP page a.php, and I want to switch control to page b.php, the only mechanism I've come across is to use header('Location: someURL") ; This has two...
2
by: quitaxe | last post by:
hi i am facing this problem when i redirect to a asp page using - Response.redirect "mynext.asp" the problem is that the current page is using frames so this mynext.asp is also getting loaded...
9
by: For Example: John Smith | last post by:
Hi, I thought this was simple to do but I have not had any luck. I would like to have two versions of my web site which are optimised for different browsers. One version for IE and one version...
7
by: DeathStorm | last post by:
How do i redirect to a different page without out changeing the address in the address bar but allowing the title to change?
3
by: lozd | last post by:
Would appreciate any solutions people could offer for this. Basically I wan't to use a frameset with an aspx page as the contents rather than a htm page and I'd like to be able to redirect the...
0
by: Sune Hansen | last post by:
Hi guys, I really hope someone can help me with my problem. Here is the scenario: I have a development environment on my locale machine. Once in a while when everything has been tested I...
9
by: Denise | last post by:
I have posted a similar message in 2 other forums but got no response. I have spent more hours than I can count researching this. Can anyone provide some insight...? Our ASP.Net application...
5
by: Dan | last post by:
Hi, i try to redirect to another aspx page with jscript. I use "OnClientClick" but nothing happens. I tried two ways. What am i doing wrong? Thanks Dan ....
17
by: mansb2002 | last post by:
Hi, We recently moved our webserver from Win2K to Win2003. The application works fine. Only problem is that when user views a report as a PDF, IE does not show it. The following code is used to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.