请帮我弄清楚我的错误。这似乎是正确的,但我无法在表格中获得价值。
<form action="validate.php" id="form">
<input type="text" name="email" placeholder="Email" required>
<input type="text" name="name" class="transparent form-group col-sm-5 col-xs-offset-1" placeholder="Name" required><br>
<input type="text" name="company" class="transparent form-group col-sm-6" placeholder="Company" required>
<input type="text" name="contact" class="transparent form-group col-sm-5 col-xs-offset-1" placeholder="Contact No." required>
<textarea id="message" name="message" placeholder="Message" rows="4" cols="54" required></textarea>
<input type="image" src="img/send_btn.png" alt="Submit" class="pull-right">
</form>
validate.php
<?php
$email = $_POST['email'];
$content = $_POST['message'];
$name = $_POST['name'];
$company = $_POST['company'];
$contact = $_POST['contact'];
?>
答案 0 :(得分:3)
您的表单没有&#34;方法&#34;指定,并默认为GET。您的validate.php文件只接受通过POST的方法。尝试更改表单定义:
<input type="text" class="form-control" name="phonenubmer" value="">