在我的 HTML 中使用下拉选项的 PHP 代码无法正常工作。我正在使用 POST 作为检索方法,它导致了 404 消息



难道我不应该使用POST方法来获取员工的信息吗?我以前用过这个表格,当时只有姓名、电子邮件和电话,效果很好。我是PHP的新手,有点迷路了。

我编辑了一点表单,这样它就不会永远持续下去,所以我为冗长的代码道歉(这是我的第一篇文章(。我真的只是专注于将表单的下拉菜单转换为PHP,因为我相信这是我真正的问题。

这是我的下拉HTML(已编辑(

<form action="solutions_form.php" method="post" >
<div class="ai-s7-row2">
<label for="">phone</label>
<input type="text" name="phone" required="required" placeholder="Enter your phone">
</div>

<div class="ai-s7-row2">
<label for="">website</label>
<input type="text" name="website" required="required" placeholder="Enter your website">
</div>

<div class="ai-s7-row3 form-message-area">
<label for="">tell us a little about your business's compliance and/or regulartory needs</label>
<textarea name="message" required="required" placeholder="Enter your message"></textarea>
</div>

<div class="ai-s7-row2">
<label for="employees">number of employees</label>
<div class="ai-s7-row3">
<select id="employees" name="employees">
<option value=""> Pick an option</option>
<option value="< 10"> &#60; 10</option>
<option value="< 100">&#60; 100</option>
<option value="< 1000">&#60; 1000</option><option value="> 1000">more than 1000</option>
</select>
</div>
</div>
<div class="form-btn-bx">
<input type="submit" class="form-submit-btn" value="Submit">
</div>
</form>

This what I have in my PHP
/* Data Variables */
$name = $_POST['name'];
$email = $_POST['email'];
$organization = $_POST['organizatioon'];
$industry = $_POST['$industry'] ;
$phone = $_POST['phone'];
$website = $_POST['website'];
$message = $_POST['message'];
$employees = $_POST['employees'];
$honeypot = $_POST['_honey'];



$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Organization: $organization <br>
Industry: $industry <br>
Phone: $phone <br>
Website: $website <br>
Message: $message <br>
Employees: $employees <br>

EOD;
$headers = "From: $emailrn";
$headers .= "Content-type: text/htmlrn";
$success = mail($webMaster, $emailSubject, $body,
$headers);

需要添加表单,method="张贴";action='PHP文件地址'

最新更新