I have a simple php scrip which launches the user's email client with a specified address. At the end of the script, I want to close the page running the script. Is this possible? <?php $loc='<META HTTP-EQUIV="Refresh" Content="0; URL=mailto:'.$part1.'@'.$part2.'">'; echo $loc; ?> Code (markup):
No because it will already have redirected them. Why would you need the page to close? If you must you can't use JavaScript.
I want the window to close so there is not a blank browser window left open. The php page is launched from an html page. The php page opens the email client.
you can do it if you have a mail form on your php page (which is probably a better solution to do what you are trying to do) if you want to have control over when the page closes. you can't close it, but you can redirect it after a time limit.