Redirect Page Script in PHP

Discussion in 'PHP' started by scripts99, Mar 4, 2010.

  1. #1
    -------------------------------------


    <form name="Downloadphpscript and Justdialclone">
    <center>
    <font face="Arial"><b>You will be redirected to the script in<br><br>
    <form>
    <input type="text" size="3" name="redirect2">
    </form>
    seconds</b></font>
    </center>

    <script>
    <!--

    /*
    Count down then redirect script
    By JavaScript Kit (yourwebsitename)
    Over 400+ free scripts here!
    */

    //change below target URL to your own
    var targetURL="yourwebsitename"
    //change the second to start counting down from
    var countdownfrom=10


    var currentsecond=document.redirect.redirect2.value=countdownfrom+1
    function countredirect(){
    if (currentsecond!=1){
    currentsecond-=1
    document.redirect.redirect2.value=currentsecond
    }
    else{
    window.location=targetURL
    return
    }
    setTimeout("countredirect()",1000)
    }

    countredirect()
    //-->
    </script>

    ------------------------------
     
    scripts99, Mar 4, 2010 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    whats the question here?
     
    bartolay13, Mar 4, 2010 IP
  3. webdevuk

    webdevuk Member

    Messages:
    318
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    43
    #3
    To Redirect in PHP simple put the following : <?php Header("Location: yoururl.com"); ?>
     
    webdevuk, Mar 4, 2010 IP
  4. HivelocityDD

    HivelocityDD Peon

    Messages:
    179
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I am not sure what you are looking for ... If you are trying to redirect using php function, you can make use of the header function

    as

    
    
    header("location:url");
    
    
    PHP:
    If you are trying to use js then its possible using

     window.location=url; 
    Code (markup):
    But in your code I cant find a place where you call the js function either.
     
    HivelocityDD, Mar 4, 2010 IP
  5. dottech

    dottech Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I think you need to visit this place pakandu.com they will
    provide solution almost at no price.
     
    dottech, Mar 4, 2010 IP
  6. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #6

    Furthermore, I think he wants a way to redirect upon a countdown but in php, which can be achieved with html (which is more reliable than js).

    http://webdesign.about.com/od/metataglibraries/a/aa080300a.htm
     
    danx10, Mar 4, 2010 IP
  7. fibi

    fibi Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    still, the best way is to use HTML Meta

    
    <HTML>
    <HEAD>
    …
    <META HTTP-EQUIV="refresh" CONTENT="seconds;URL=the-other-url">
    …
    </HEAD>
    <BODY>
    …
    </BODY>
    </HTML> 
    
    PHP:
     
    fibi, Mar 5, 2010 IP