1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to Open a new webpage in new window after 10 seconds in php?

Discussion in 'Cloaking and Content Generators' started by mymindrules27, Nov 3, 2010.

  1. mymindrules27

    mymindrules27 Newbie

    Joined:
    Jul 10, 2010
    Messages:
    45
    Likes Received:
    2
    How to Open a new webpage in new window after 10 seconds in php?

    It is like if i am browsing hxxp://xyz.com , then after 10 seconds a new window open with the url http://abc.com automatically

    Any idea?
     
  2. SupraFast

    SupraFast Junior Member

    Joined:
    Jun 24, 2009
    Messages:
    151
    Likes Received:
    34
    Will require java script to be enabled.

    <html>
    <head>
    <script type="text/javascript">
    function delayer(){
    window.location = "hxxp://www.website.ext"
    }
    </script>
    </head>
    <body onLoad="setTimeout('delayer()', 10000)">
    Redirecting in 10 seconds.
    </body>
    </html>
     
  3. mymindrules27

    mymindrules27 Newbie

    Joined:
    Jul 10, 2010
    Messages:
    45
    Likes Received:
    2
    Will it open in new window?
    What i want is that hxxp://xyz.com should not be closed and after 10 seconds a new window open with the url hxxp://abc.com automatically without closing the hxxp://xyz.com .
     
  4. mymindrules27

    mymindrules27 Newbie

    Joined:
    Jul 10, 2010
    Messages:
    45
    Likes Received:
    2
    I have tried:

    <script>
    window.open("hxxp://abc.com", "_blank", "");
    </script>

    It is opening in new window but it is blocking as a pop up .
    I dont want in this way , please suggest.

    Thanks
     
  5. Samsonette

    Samsonette Newbie

    Joined:
    Jan 19, 2009
    Messages:
    23
    Likes Received:
    632
    Gender:
    Female
    Occupation:
    retired - but extremely active ;-)
    Location:
    ô¿Ô I see all I shouldn't
    Warning :) .. I'm not a PHP-coder.
    Coming from Perl I now try to learn a bit PHP.

    Haven't tried, but I think it should work this way:

    Code:
    <?php
        // Send HTTP-Status for Document to Client
        header ("HTTP/1.0 404 Not Found");
        // Send Refresh-Header with Timeout and New URL to Client
        header ("Refresh: 10; url=http://yourdomain.com/");
    
        // Followed by your HTML-Content:
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
           "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <title>Your Title here!</title>
        </head>
        <body>
            <h1>Nice Big Headline</h1>
            <p>
                You will be redirected in 10 sec.
                If not, please click <a href="http://yourdomain.com/" title="">here</a>.
            </p>
        </body>
    </html>

    Edit:
    yes, just tried it and it works.

    BUT it doesnt open in a new window as OP wrote in his headline.
    Sorry, don't know enough PHP and how to manage that :(
     
    Last edited: Nov 5, 2010