Jump to content




Recent Status Updates

  • Photo
      18 Aug
    KodeKool

    When faced with a wall of errors and no hope to fix them, remember the following "Programs always do what you tell them to, and seldom what you want them to, but eventually you'll run out of things that can go wrong and it'll just work. and that's the secret to good programming."

    Show comments (2)
  • Photo
      11 Aug
    Error

    Should I be practicing programming every day? I feel if I don't, I'll get instantly rusty or something.

    Show comments (4)
View All Updates

Developed by Kemal Taskin
Photo
- - - - -

PHP refresh/redirect script!

redirect

  • Please log in to reply
2 replies to this topic

#1 pormadori

pormadori

    CC Newcomer

  • Just Joined
  • PipPip
  • 20 posts

Posted 05 May 2009 - 08:42 AM

<?php
header("Refresh: 5; url=http://www.aesdfhtg.com/");
?>
<html>
<body>
Test test
</body>
</html>


This script will just after 5 seconds redirect user to page www.aesdfhtg.com

How to make the script so it does like this:
1. Refreshes the page after 5 seconds.
2. Refreshes the page again, but after 8 seconds.
3. Waits 2 seconds and redirects user to page www.aesdfhtg.com

How should the script look like?
  • 0

#2 Orjan

Orjan

    CC Mentor

  • Moderator
  • 2,918 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#

Posted 07 May 2009 - 03:05 AM

you need an parameter sent with the page telling in which phase of the updating you hare like

http://www.aesdfhtg.com?p=1

and change the number for each phase, then in your php-file, you have a switch statement telling what to do on each phase...
  • 0

I'm a System developer at Redpill Linpro mainly working with SugarCRM.
Please DO NOT send mail or PM to me with programming questions, post them in the appropriate forum instead, where I and others can answer you.


#3 MohammadReza

MohammadReza

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 10 May 2009 - 12:57 PM

Hi,

Here is a sample :



<?php
//------------
if(isset($_GET['w'])){
//--
$wait = $_GET['w'];
$url = ""; // Put here you address.
header("Refresh: $wait; url=$url");
//--
}else{
};
?>



Regards,
Mohammad Reza
  • 0





Also tagged with one or more of these keywords: redirect