我有一个带有以下按钮的表格:
<input name="send_message" type="submit" value="SEND A MESSAGE" />
此按钮将在 php 脚本下方触发:
if(isset($_POST['send_message'])){
$emails = "";
if(!empty($_POST['id'])){
foreach($_POST['id'] as $email){
if($emails == ""){
$tempemail = explode("/",$email);
$emails = $tempemail[1];
}else{
$tempemail = explode("/",$email);
$emails .= ";" . $tempemail[1];
}
}
if(!empty($emails)){
echo "<script>window.location = \"mailto:me@abc.com 'recipient'?bcc=".$emails."&subject=Hello%20:%20\"</script>";
}
上面的脚本工作正常,但是当电子邮件客户端打开时,父窗口是空白的,除非我手动刷新页面,我希望在弹出电子邮件客户端时重新加载父窗口,有人可以帮忙吗?谢谢。
编辑:
解决方案:
echo "<script>location.href = \"mailto:me@abc.com 'recipient'?bcc=".$emails."&subject=Hello%20:%20\"</script>";
echo "<script>window.location.href = "'.$_SERVER['PHP_SELF'].'"</script>";
感谢 Panayot Karabakalov 的一些想法。