Reply to Re: Need some help on header refresh...

Your name:

Reply:


Posted by Jerry Stuckle on 03/03/07 13:47

Justin wrote:
> On Mar 3, 11:29 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> Justin wrote:
>>> Harlow... i need some help on these... im actually trying to do a page
>>> using php... the function is to receive certain parameters from a 3rd
>>> party provider... and i need to redirect my page to another page after
>>> certain validation. it's ok when i use the url to do the testing...
>>> the validation part works fine... scenario as below:
>>> if situation a, echo abc
>>> if situation b, echo abc then refresh to another page.
>>> the problem is after the 3rd party call my page the refresh doesnt
>>> work... after doing some amendments, it redirects to another page but
>>> doesnt echo abc... so any other way to redirect the page??? tried
>>> output buffer start and flush but still couldn.... SOS...
>>> Regards,
>>> Justin
>> You can use header() calls to redirect, but it is incompatible with
>> echo(). You can't send ANY output to the browser before a header() call.
>>
>> But if you're redirecting, any output you send would not be displayed
>> anyway - so why bother sending it?
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================
>
> er... the requirement from my 3rd party provider is that i have to
> reply -1 once receive the parameters from them.. so i put echo -1. is
> there any other way to send instead of echo? the redirecting part is
> something i wan to add on... it's not in the API they provided...
>

OK, you have to respond with a -1. But once you send ANY output, you
can't use a header() call.

header() must be called before the headers are sent to the browser. And
any output - even white space - will cause the headers to be sent. So
you can either send a response or do the redirect. But the HTTP
protocol (not PHP) won't let you do both.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация