用户点击箭头链接但没有发生任何事情

时间:2015-12-29 15:14:31

标签: php ajax

当用户点击箭头链接时,我想使用php发送邮件,但没有发生任何事情

<?php
    if(isset($_GET['sendmail'])){
        $array = array("with_whom" => "With whom do we have the pleasure of speaking?", "interest" => "So, what is your interest area ?", "wru" => "Who are you?", "city" => "In which city d  you live.");
        $formData = "";
        foreach($_GET as $name => $value){
            $$name = urldecode($value);
            if($value && $value != "" && $value != "_"){
                $formData .= "<tr><td>".$name."</td><td>".$value."</td></tr>";
            }
        }
        $headers = "";
        //$headers .= "From: " . $from . "\r\n";
        $headers .= "Content-type: text/html\r\n";
        $to = "hello@bywayofdesign.com";
        $subject = "Contact form";
        $message = "<table border='1' cellpadding=5 cellspacing=5 rules='all' style='border-collapse: seperate'>";
        $message .= $formData;
        $message .= "</table>";
        echo $message;
        mail($to, $subject, $message, $headers);
    }
?>

0 个答案:

没有答案