473,402 Members | 2,055 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,402 software developers and data experts.

redirect after auto script

I have a page 'pni.php' to which paypal is redirecting after payment
thsi page contains a db update script, no problem it's running well

but once this script is executed (transparently for the use, as there
is nothing to display)
how can I redirect to another page ?

header redirect can only be placed at the beginning of the page... not
at the end
I've already writen redirection but only when there was a form inside
and a user action.. to refresh the page , this is not the case ... :-((

pni.php
<?
DN update script from Paypal _POST data
....
(no display, no user action)
...
auto redirect to another page ? -> index.php
?>

Feb 17 '06 #1
5 7560
You "can" make a call to header() at the end of the page as long as
there's been no output to the broswer. If you're using include() or
require(), make sure there's no newlines or extra spaces in the update
script or else the call to header() will fail.

Feb 18 '06 #2
On 2006-02-17, Josselin <jo******@wanadoo.fr> wrote:
I have a page 'pni.php' to which paypal is redirecting after payment
thsi page contains a db update script, no problem it's running well

but once this script is executed (transparently for the use, as there
is nothing to display)
how can I redirect to another page ?

header redirect can only be placed at the beginning of the page... not
at the end
I've already writen redirection but only when there was a form inside
and a user action.. to refresh the page , this is not the case ... :-((
headers must come before any emitted content.
but needn't come at the start of the script.

if the script produces no output you can put the header() call anywhere.
pni.php
<?
DN update script from Paypal _POST data
...
(no display, no user action)
..
auto redirect to another page ? -> index.php
?>


you can put the header at either end of the script. it makes no difference
as long as it has no produced content before it.

Bye.
Jasen
Feb 18 '06 #3
On 2006-02-18 09:09:05 +0100, Jasen Betts <ja***@free.net.nz> said:
On 2006-02-17, Josselin <jo******@wanadoo.fr> wrote:
I have a page 'pni.php' to which paypal is redirecting after payment
thsi page contains a db update script, no problem it's running well

but once this script is executed (transparently for the use, as there
is nothing to display)
how can I redirect to another page ?

header redirect can only be placed at the beginning of the page... not
at the end
I've already writen redirection but only when there was a form inside
and a user action.. to refresh the page , this is not the case ... :-((


headers must come before any emitted content.
but needn't come at the start of the script.

if the script produces no output you can put the header() call anywhere.
pni.php
<?
DN update script from Paypal _POST data
...
(no display, no user action)
..
auto redirect to another page ? -> index.php
?>


you can put the header at either end of the script. it makes no difference
as long as it has no produced content before it.

Bye.
Jasen


Thanks for you answers ... after a good rest, I discovered that I put
it in the wrong included files ...

pni.php includes pni_succes.php end include pni_error.php
the redirect MUST be writtent at the end of the pni_php !!!
Feb 18 '06 #4
On 2006-02-18 05:11:13 +0100, "samudasu" <sa******@hotmail.com> said:
You "can" make a call to header() at the end of the page as long as
there's been no output to the broswer. If you're using include() or
require(), make sure there's no newlines or extra spaces in the update
script or else the call to header() will fail.


Thanks for you answers ... after a good rest, I discovered that I put
it in the wrong included files ...

pni.php includes pni_succes.php end include pni_error.php
the redirect MUST be writtent at the end of the pni_php !!!

Feb 18 '06 #5
<meta http-equiv="refresh" content="x;url=./index.php" />

Where x is number of seconds before redirect
put it into the header of you page. And put some link that the user can
follow if the redirect does not work

Feb 18 '06 #6

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

Similar topics

10
by: Bob Garbados | last post by:
forgive my ignorance, as I'm new to php coming from a ms background... If I create a page named redirect.php and it's only content is: <?php header("Location: http://www.google.com"); ?>...
2
by: Sentinel | last post by:
here is the entire thread From: "Kimmo Laine" <eternal.erectionN0.5P@Mgmail.com> Subject: Re: script in body Date: Mon, 20 Jun 2005 17:46:28 +0300 Message-ID:...
2
by: Robert Gordon | last post by:
I now realize I probably should have tried posting this on the IIS board first.. I am running OWA 2003 Server as Front End server to my Exchange 2000 native domain. The FE server is secured by...
7
by: Donna Hawkins | last post by:
I want to use javascript to redirect to a URL which has been passed as a variable (in php). I have searched but cannot find any solution. I think this code is a basic redirect: <script...
2
by: dh | last post by:
How can a button that resides on the Main page tell the child Iframes to redirect without the page posting back? I keep getting a javascript error: "frames.iframe1 is null or not an object." I'm...
6
by: Coleen | last post by:
Hi all :-) I need to redirect to multiple pages on click of a transmit button, without redisplaying each page. This redirection is to capture session variables that are created on each page and...
4
by: davidfahy | last post by:
Hi all How can I transfer user to another server using POST. The problem is that Server.Transfer (preserves form data) works just in current server. Response.Redirect - uses GET method. However...
11
by: vinceboy | last post by:
Hi..guys!I have a drop down menu with javascript null validation.However,instead of clicking submit button,it will immediately auto redirect after option was selected.Is it possible to prevent this...
1
by: gnawz | last post by:
Hi guys, I have a couple of php files that perform various tasks. I will use fields in my system and provide code as well I need help as follows: My database contains the fields Category...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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...
0
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
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...
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...

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.