I know php is server-side, but is there a way to make this window close after 3 seconds?
<link rel="stylesheet" type="text/css" href="style1.css" />
<?php
$contact_message=$_POST['message'];
$errpage = $_POST['frompage'];
$ip=$_SERVER['REMOTE_ADDR'];
$message = "$contact_message -SENT FROM THIS IP: $ip";
mail("[email protected]", "$Error Reported on: $errpage", $message);
echo "We have documented the web address of the problem and thank you for helping us improve our site!"
?>
I know php is server-side, but is there a way to make this window close after 3 seconds?
<link rel="stylesheet" type="text/css" href="style1.css" />
<?php
$contact_message=$_POST['message'];
$errpage = $_POST['frompage'];
$ip=$_SERVER['REMOTE_ADDR'];
$message = "$contact_message -SENT FROM THIS IP: $ip";
mail("[email protected]", "$Error Reported on: $errpage", $message);
echo "We have documented the web address of the problem and thank you for helping us improve our site!"
?>
Share
Improve this question
edited Oct 9, 2012 at 1:48
bfavaretto
71.9k18 gold badges117 silver badges159 bronze badges
asked Oct 9, 2012 at 1:31
Max GeeMax Gee
1171 gold badge3 silver badges9 bronze badges
2
- 1 if anything, you'd be looking at javascript to attempt achieve what you want. – anditpainsme Commented Oct 9, 2012 at 1:35
- @anditpainsme Do you know a script that would do that? – Max Gee Commented Oct 9, 2012 at 1:36
3 Answers
Reset to default 9This should do it:
<script type="text/javascript">setTimeout("window.close();", 3000);</script>
It is very simple - just write the JavaScript code in PHP with echo in the place where you want to move out from itself, such as:
<?php
echo '<script> window.setTimeout("window.close()", 1000); </script>';
?>
It will definitely work.
It may seems a little weird if a page I am watching suddenly be closed.