redirect after secconds?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

redirect after secconds?

sina miandashti
hi

its possible to use the $this->view->_redirect()  to an adress after 3
secconds ?

--
________________
Sincerely
Sina Miandashti
MuSicBasE.ir & InvisionPower.ir Admin
Reply | Threaded
Open this post in threaded view
|

Re: redirect after secconds?

Jurian Sluiman-4
Hi,
As far as I know it's only possible with a Refresh header. A custom header is the only option:
$this->getResponse()->setHeader('Refresh', '3; URL=http://my.url.com');


Regards, Jurian
--
Jurian Sluiman
Soflomo.com


Op Saturday 26 September 2009 11:26:29 schreef sina miandashti:
> hi
>
> its possible to use the $this->view->_redirect() to an adress after 3
> secconds ?


signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: redirect after secconds?

Ralph Schindler-2
In reply to this post by sina miandashti
Generally speaking, html meta tags and javascript are the better ways to
implement this.  By the time the client has the web page, your
application is already finished (the request has been delivered as a
response).

If it were me, I'd do a javascript timed redirect inside the view script.

The first link has a "delayed" redirect, but the others are good too:
http://www.google.com/search?q=javascript+redirect

-ralph

sina miandashti wrote:
> hi
>
> its possible to use the $this->view->_redirect()  to an adress after 3
> secconds ?
>
Reply | Threaded
Open this post in threaded view
|

Re: redirect after secconds?

Andy L.
IMO, html meta redirect is better than javascript redirect. Javascript redirection has accessibility issues. Browser with javascript disabled can not be redirected, etc.

But besides that all, redirection after seconds should not be used because of accessibility issue. You can redirect using HTTP header instead.

Here is the reference: http://www.w3.org/TR/WCAG10-CORE-TECHS/#auto-page-refresh

"Until user agents provide the ability to stop auto-redirect, do not use markup to redirect pages automatically. Instead, configure the server to perform redirects. This automatic refresh can be very disorienting to some users"

On Tue, Sep 29, 2009 at 7:55 AM, Ralph Schindler <[hidden email]> wrote:
Generally speaking, html meta tags and javascript are the better ways to implement this.  By the time the client has the web page, your application is already finished (the request has been delivered as a response).

If it were me, I'd do a javascript timed redirect inside the view script.

The first link has a "delayed" redirect, but the others are good too:
http://www.google.com/search?q=javascript+redirect

-ralph


sina miandashti wrote:
hi

its possible to use the $this->view->_redirect()  to an adress after 3
secconds ?





--
Best regards,

Andy L.
Reply | Threaded
Open this post in threaded view
|

Re: redirect after secconds?

sina miandashti
thanks all...:X


--
________________
Sincerely
Sina Miandashti
MuSicBasE.ir & InvisionPower.ir Admin
Reply | Threaded
Open this post in threaded view
|

Re: redirect after secconds?

Dolf Schimmel
sleep(3);
$this->view->_redirect()

On Tue, Sep 29, 2009 at 7:13 AM, sina miandashti <[hidden email]> wrote:
> thanks all...:X
>
>
> --
> ________________
> Sincerely
> Sina Miandashti
> MuSicBasE.ir & InvisionPower.ir Admin
>
Reply | Threaded
Open this post in threaded view
|

Re: redirect after secconds?

Peter Warnock-2
Dolf:

That was my original thought, but I think the use case calls for sending output to the browser, in which the redirect would not work. - pw

On Tue, Sep 29, 2009 at 2:31 PM, Dolf Schimmel <[hidden email]> wrote:
sleep(3);
$this->view->_redirect()

On Tue, Sep 29, 2009 at 7:13 AM, sina miandashti <[hidden email]> wrote:
> thanks all...:X
>
>
> --
> ________________
> Sincerely
> Sina Miandashti
> MuSicBasE.ir & InvisionPower.ir Admin
>


Reply | Threaded
Open this post in threaded view
|

Re: redirect after secconds?

SpiffyJr

Peter Warnock-2 wrote
Dolf:

That was my original thought, but I think the use case calls for sending
output to the browser, in which the redirect would not work. - pw

On Tue, Sep 29, 2009 at 2:31 PM, Dolf Schimmel <dolfschimmel@gmail.com>wrote:

> sleep(3);
> $this->view->_redirect()
>
> On Tue, Sep 29, 2009 at 7:13 AM, sina miandashti <miandashti@gmail.com>
> wrote:
> > thanks all...:X
> >
> >
> > --
> > ________________
> > Sincerely
> > Sina Miandashti
> > MuSicBasE.ir & InvisionPower.ir Admin
> >
>
>

Isn't that done easily enough using Meta tags?

$this->headMeta()->appendHttpEquiv('Refresh', '3;URL=http://www.yourdomain.com');
Kyle S
blogs @ www.spiffyjr.me
github @ www.github.com/spiffyjr
follow @ www.twitter.com/spiffyjr
Reply | Threaded
Open this post in threaded view
|

Re: Re: re[fw-mvc] direct after secconds?

Jurian Sluiman-4
Yups, and that was the solution I already posted, but with a Header instead of a HttpEquiv ;)
One of those are really the most simple one and work the best (others have more problems than these two).
Regards, Jurian
--
Jurian Sluiman
Soflomo.com


Op Wednesday 30 September 2009 03:50:32 schreef Kyle Spraggs:
> Peter Warnock-2 wrote:
> > Dolf:
> >
> > That was my original thought, but I think the use case calls for sending
> > output to the browser, in which the redirect would not work. - pw
> >
> > On Tue, Sep 29, 2009 at 2:31 PM, Dolf Schimmel
> >
> > <[hidden email]>wrote:
> >> sleep(3);
> >> $this->view->_redirect()
> >>
> >> On Tue, Sep 29, 2009 at 7:13 AM, sina miandashti <[hidden email]>
> >>
> >> wrote:
> >> > thanks all...:X
> >> >
> >> >
> >> > --
> >> > ________________
> >> > Sincerely
> >> > Sina Miandashti
> >> > MuSicBasE.ir & InvisionPower.ir Admin
>
> Isn't that done easily enough using Meta tags?
>
> $this->headMeta()->appendHttpEquiv('Refresh',
> '3;URL=http://www.yourdomain.com');


signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: redirect after secconds?

Ralph Schindler-2
In reply to this post by Dolf Schimmel
It sounds as if they want there to be a page visible to the user for 3
seconds before redirecting.  In general, unless there is some kind of
slow server side processing going on, you would never really want to use
sleep(), during a request.

This effectively will pause the script from running, and during that
time, it will just look like the server is hung.  The more ideal
solution is, as they noted, the HttpEquiv.  That is a good solution and
very x-browser compatible.  Personally, given the environments I target
with my applications, the browsers, and the general availability of
javascript.. this kind of thing would typically be done with a
javascript redirect.

-ralph

Dolf Schimmel wrote:

> sleep(3);
> $this->view->_redirect()
>
> On Tue, Sep 29, 2009 at 7:13 AM, sina miandashti <[hidden email]> wrote:
>> thanks all...:X
>>
>>
>> --
>> ________________
>> Sincerely
>> Sina Miandashti
>> MuSicBasE.ir & InvisionPower.ir Admin
>>
>
>