473,657 Members | 2,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7572
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******@wanad oo.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******@wanad oo.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******@hotma il.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
9347
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"); ?> Should it not redirect to www.google.com? I can't get the header() function to redirect. I'm trying to take an online reservation... the customer fills out
2
2306
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: <d96klv$8vi$1@phys-news1.kolumbus.fi> Lines: 64 "Sentinel" <support@elma.hr> kirjoitti
2
7799
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 a 128 bit SSL cert. The OWA 2003 server is running on Windows 2003 server in a Windows 2003 native AD domain. At present, the server is configured so that user's have to specifically go to the URL httpS://myserver.company.com in order to access...
7
15912
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 type="text/javascript"> window.location = "http://www.someserver.com/somePage.html"; </script>
2
2784
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 assuming this is because when i press the button it reloads the page and the frames can't be referenced. here's a simple example: <HTML> <script language="C#" runat="server">
6
5797
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 pass them to the main page to be displayed. We are actually NOT using session variables, but storing the values in a temporary table. The problem is that the values don't get stored in the temporary table unless the user goes to each page...
4
2251
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 I have to open a remote server page using POST method. Using HttpWebRequest class is not good solution, as I can post to and read data from remote server, but user browser itselft is still connected to my
11
2636
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 kind of fast respond? <select name="rNumber" title="number of ticket" onChange="GoToNextPage(this.value)"> <option selected>Select</option> <option>01</option> ...
1
7280
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 and Brand I need to make some changes on a a number of brands in a Category
0
8384
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
8302
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8718
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...
1
8499
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5630
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
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
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.