-2
我正在做一個非常簡單的訂閱表單,用戶填寫姓名和電子郵件,然後按訂閱按鈕。使用PHP郵件()在AngularJS中發送郵件
我不明白爲什麼這不起作用..有什麼在這裏失蹤?
<form class="form-signin" role="form" name='subscriptionForm' action='/' method='post'>
<h4 class="form-signin-heading">Get new articles via email</h4>
<input type="text" class="form-control" name="name" placeholder="Name" required autofocus>
<br/>
<input type="text" class="form-control" name="email" placeholder="Email address" required autofocus>
<br/>
<button class="btn btn-lg btn-primary btn-block" data-toggle="dropdown" type="submit">Subscribe Me!</button>
<br/><br/>
<?php
if (isset($_REQUEST['name']) && isset($_REQUEST['email']))
//if email is filled out, send email
{
$to = "[email protected]";
$subject = "Thngs Of That Nature | Article Subscription";
$name = $_POST['name'] ;
$message = 'Hello there, I would like to subscribe to Thngs Of That Nature!' ;
$from = $_REQUEST['email'] ;
$headers = $name .'('. $from .')';
mail($to, $subject, $message, $headers);
echo "<div class='fb'>Awe! <b>" .$name ." Stay sharP!";
} else {
echo "NOPE!";
};
?>
</form>
您錯過了您的問題 –
除了您的應用程序可能被黑客通過注入頭文件發送數千封垃圾郵件這一事實? – h2ooooooo
什麼。 IS。 THE。問題? –