Results 1 to 2 of 2

Thread: Open a new webpage

  1. #1
    Join Date
    Jan 2006
    Location
    Derbyshire, UK
    Posts
    74
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Open a new webpage

    I'm using a PHP file to activate an email form and understand very little of PHP but the end of the file is below.

    After they prove they are human the thank you image opens but if they fail it opens the failed image, inviting them to try again. That bit works great.

    Is it possible for the section that opens the thank you image to then go to a new webpage after say 10 seconds?

    Here's the end of the code I'm using...
    Code:
    	
    	|---------END MESSAGE----------|'; 
    
    		mail($to, $subject, $body);
    	
    		
    		echo "<style type='text/css'>body{width:450px; height:390px; margin:0px; padding:0px;}</style><div style='width:width:450px; height:390px; margin:0px; padding:0px; background:url(../../assets/images/bkgs/form-thanx-find.png); filter:alpha(opacity=100);'></div>"; /* YOUR CODE GOES HERE */ 
    		unset($_SESSION[captcha]); /* this line makes session free, we recommend you to keep it */
    	} 
    elseif($_SERVER['REQUEST_METHOD'] == "POST" && !$_POST[captcha])
    	{
    		echo "<style type='text/css'>body{width:450px; height:390px; margin:0px; padding:0px;}</style><div style='width:450px; height:390px; margin:0px; padding:0px; background:url(../../assets/images/bkgs/form-fail-find.png); filter:alpha(opacity=100);'></div>";
    	}
    /* in case that form isn't submitted this file will create a random number and save it in session */
    else
    	{
    		$rand = rand(0,4);
    		$_SESSION[captcha] = $rand;
    		echo $rand;
    	}
    ?>
    Last edited by Burgin; 06-08-2011 at 10:35 AM.

  2. #2
    Join Date
    Sep 2008
    Location
    Midland, Texas
    Posts
    52
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default

    I think you would be better served by using JavaScript to accomplish the redirection. Checkout the link below:

    http://www.w3schools.com/js/js_timing.asp

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •