|
Posted by Justin on 03/07/07 03:57
Dear Jerry,
You fully understand the situation im in right now... Mayb i will
elaborate more on this.
My application is to correspond with a mobile provider gateway
using HTTP calls. And meta refresh is not allowed.
Initially i din have to do any redirect as the process is actually
very simple. Once a mobile user register the service with their mobile
phone, the provider will call/send in the parameters to my
page(assuming receive.php). And upon receiving the parameters, i need
to echo "-1"; to the provider so a standard message will be sent out
to the registrant. The -1 is a requirement from my provider. So they
only recognized this. (according to their API). The reason why i have
to redirect is because some registrant might not be providing enough
information, so i did a strlen($sms) on the sms receive to see how
many characters is there and therefore determine whehter the info is
complete or not... So there are 2 situations, complete info and
incomplete info. Both i will reply -1 for them to receive the standard
sms but only those with incomplete info will receive a customized msg
from my side. That's the thing. If i put on the same page, those with
incomplete msg cant receive anything ask the provider only recognized
-1 for the registration process.... Thanx.
On Mar 4, 7:21 am, Rik <luiheidsgoe...@hotmail.com> wrote:
> Jerry Stuckle <jstuck...@attglobal.net> wrote:
> >> 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.
>
> Allthough...
> You can have a header redirect & output, I'm a bit fuzzy on wether this is
> actually allowed with the HTTP protocol, but for instance, I can disable
> automatic redirects (yes, also header redirects) in Opera, and I'll see
> the content that comes next. So I see no practical reason why you cannot
> send a redirect header & some content, as long as you set the header first
> in PHP. There is a reason it's so often advised to die()/exit() after a
> redirect statement.
> --
> Rik Wasmus
[Back to original message]
|