我試圖通過「mail()」函數在我的郵件ID上獲取「註冊用戶信息」。郵件()函數工作正常,並且能夠發送郵件郵件ID,但無法獲取用戶詳細信息。 這裏是我的HTML代碼:獲取郵件ID的用戶信息
<form action="registration.php" id="reg_form">
<div class="form-msg alert with-icon alert-warning">
<i class="fa fa-info-circle"></i>
<span id="text-login-msg">
Put your valid Emai id and we will mail you the login details on your register id.
</span>
</div>
<div class="row">
<div class="form-group col-md-12">
<label>
Name<span class="red">*</span>
</label>
<input type="text" class="form-control" name="name" required>
</div>
</div>
<div class="row">
<div class="form-group col-md-12">
<label>
Email<span class="red">*</span>
</label>
<input type="email" class="form-control" name="email" required>
</div>
</div>
<div class="clearfix"></div>
<div class="button-group">
<input type="submit" class="btn btn-lg main-bg btn-block" value="Submit">
</div>
</form>
這是我的PHP代碼:
$headers = "From: [email protected]";
$to = "[email protected]";
$Email = $_POST['email'];
$Name = $_POST['name'];
$subject = "Registration";
$email_message = "Form details below. \r\n";
$email_message .= "Name: ".$Name. "\r\n";
$email_message .= "Email: ".$Email. "\r\n";
mail ($to, $subject, $email_message, $headers);
header("Location: thank-you.html");
在此先感謝。
謝謝,它的工作,愚蠢的錯誤是在我身邊做。 – Shubham