Jump to content





Recent Status Updates

  • Photo
      10 Apr
    Poe

    Finally (and hopefully) i'm getting a team together that knows a little of this and a little of that; and maybe all my open source projects that are half written can begin to be released. :)

View All Updates
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,910 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