PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, December 30, 2021

[FIXED] Cakephp redirect after x seconds?

 December 30, 2021     cakephp, redirect, wait     No comments   

Issue

I am looking for a simple redirect for cakephp 2.1 with a wait time.

I'd like the view page to redirect after -lets say 5 seconds- to an external url.

Any idea how I could implement this?

Thanks in advance


Solution

The easiest solutions either involve jquery/javascrpt, meta or php headers in a view. I do not believe cake has a dedicate way to do this but an alternative could be a simple for loop and just do a simple +1 count to like 5000 or whatever value is needed to take 5 seconds and then do the normal cake redirect.

simple view examples.

php header

header('Refresh: 5; URL=http://site.com/controller/action');

meta

<meta http-equiv="refresh" content="5;url=http://site.com/controller/action"/>


Answered By - Colby Guyer
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing