窗口不是在PHP JavaScript中关闭

时间:2019-01-31 20:32:40

标签: javascript php

关闭功能在php中不起作用

 <?php
    if(isset($_POST['email'])){
        $to = "mailid@domain.com";
        $email = $_POST['email'];
        $no = $_POST['number'];
        $headers = "Details of: $email";
        $headers = "From: " . $email . "\r\n";
        $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
        $subject = "You got the details of $email";
        $body="email: $email, phne: $no";
        mail($to, $subject, $body, $headers);
        echo"<script>window.close()</script>";}

//关闭fn 强文本不起作用

1 个答案:

答案 0 :(得分:0)

尝试在Javascript事件上使用window.close()。 例如,您用于发送电子邮件的表单的提交。