473,836 Members | 1,407 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 7596
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
9390
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
2311
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
7816
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
15930
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
2789
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
5811
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
2261
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
2657
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
7300
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
9820
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
10549
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
9376
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7792
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
6979
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
5650
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4456
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
4019
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
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.